refactor complete, on to testing