added memoizing metaclass