further refactoring to facilitate future design changes