Refactored javascript and added refresh free room changes.