prioroity refactor