Mass refactoring... to be continued