Improved context configuration