custom memory convertion code replaced with MemoryUnit methods