moved layout js to its own file