More code refactoring

splitting various parts of the code into multiple components