Rewrite find-definition to be single-pass