Centralized more code and added the basics for rooms.