refactor scop authorization logic