Refactor execution context to scope