Improve organization and structure of the code