refactor js in room list plugin