Refactor jQuery