Refactored jquery definition