Refactored utilities