Use helper functions to simplify code.