moving js out of markup