put call to get_gaps in validation instead of repeated code