compacted the structure to improve maintainability