abstract path checks to defun