Rebuilt the code to use the Module design pattern