Refactor policy parsing