gap check
more perf improvements