Refactored context