Refactor handling of specific targets.