improved code organization