add memoize decorator; support cmd group