remodel to fix function hoisting issues in strict mode