Some refactoring, new entities and controllers