Last commit of refactoring that seems to work