Some minor refactors