refactored jQuery