moved layout to js