tidy up and simplify