Changed the structure of the code to separate the modules more from one
another.