Big refactoring made