Simple refactoring to improve maintainability