Refactoring a lot of the code
Fixing some missing files