refactor: improve code for policies

unexpected token kEND