moved mainjs to public