Better looping through form elements