Restructuring jQuery