Various refactorings and reorganisation of the project