improve code organization