Improved context checker