Refactor room.lua a bit