Push some refactoring/cleaning, wip on the raty integration