Refactor utilities.