TODO: - get thread context (clean code + 32<->64 compat)