refactor database design for priorities