more performance tweaks, kill recursive functions on resize
more performance tweaks, migrate resize clean-up code to named function