Refactored existing codebase for easier management and development