Simplified generation of managed objects, added some implementations, not tested.