Remove unnecessary contexts.