room javascript move to separate file