small refactoring on context.