PERF: create some helper comparison functions