added ACE usage logic, minor code refactoring