Refactor and tidy up, introduce mustache.