Second part of the refactoring