Refactored code due to jQuery handling of arguments passed to jQuery.fn