Move ```ValueError``` checks to the calling function to make this more explicit.