Refactoring the chatRooms object