More refactoring

Separation of classes into different packages