tidy up the directory template fragment  a bit