resolve against explicit policy sets
cleanup error
simplify code