fully working and refactored acl