improved AttributeDict implementation