create factory, inject controller dependancies
refactor helper functions