Modify the structure of code

Divided into a few parts of classes that is to deal with the system