Applied a deep refactoring