Moving js from layout into own js file