Refactored Context class into Base and Derived classes for cleaner future development.