safer setter for IE8, refactoring