Split main js into separate file