reverting refactoring

need to write better tests before doing this refactor