lib: refactor to use validateCallback
Try replacing all duplicate checks with validateCallback
, Due to the scope of the changes, it may be necessary to run a benchmark.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines