move else case where we can find it
move lookup table out of function to make fn shorter
break up long line
start to generalise form arguments passed through to renderer
remove more duplication