Cache glyphs
clean up the code