Move priority resolution into helper