More flexible context handling