refactors, a little cleanup