refactor pluck-pairs and -main a bit