A few refactors