quite some cleanup + fix for static vars freezing zoomlevel