Extract target logic to make it reusable