Refactor function helpers.