minor tweaks, optimizations, formatting