Refactored REST utils