Improve code organization