cleaned up javascript that was in the view