Refactor functions written to facilitate API understanding.