- some more structure cleanups :
 * switched long list of if/elses to switch case (tag closing callback)
 * minor cleanups