draw loop and shape click optimizations