making some code-cleanup changes and adding a simple ACL for key management