Use constants for priority type and add comments