Moved to utility function