Moved everything to a better structure, fixed all compilation errors