Improved resolution context factory.