more refactoring of things