Big refactoring :)