Small refactoring to RestUtils class.