refactor to address issues 27 and 33