simplified and refined jquery