further structural changes, added some functionality for keeping track of encryptionkeys