refactor this down to fewer classes to simplify and figure out why its not working