Code cleanup + minor IE8 support