seperate out javascript snippets