more refactors and such