Refactored utilities to remove throwing exceptions.