cleanup and tweaks for browser compatability