PriorityFactory now uses a map to lookup priority from instead of stacked ifs.