Refactor the RelocVisitor::visit method