refactored jquery