refactored JavaScript OO with Modernizr