Refactors stuff