Improve code architecture