I should be more or less finished now with the initial refactoring