Key utility function