Bunch of small refactors