refactoring of priority planning and tests