dave - more tidying. removed excess templating