refactor: improve code for policies