refactor nearly complete pending testing