First changes for making it modular
Made it more or less modular