tucked the building output to a helper function