Refactoring with SOLID in mind