Complete restructuring, support for IE6-8