Refactors some classes