Refactoring, cleanup

Basically let CLion refactor everything with the conventions that we seem to use, as well as went and removed unused code, comments and loggings.