Contexts refactoring fix