more refactoring stuff is still broken