restructuring for maintainability