merge contexts based on contained by