cleaned up javascript behaviors for element