Refactor for util.