Seperate js from index file