New version after the massive refactoring