started #40, working through factories. need to refactor code for modules and no globals before continuing