Split javascript out