making the context reusable for different object types