Outsourcing the js-code