moved functions to helper class, added private variables to keep state in helpers, cleaned up a bit