Refactor theme templates for IE compatibility