fix issues with IE9 + refactoring