Modularization of the code