refactor mode to policy