Adds Access policies extraction, and code cleanup