refactor - tidy up and simplify