add mallinfo
refactoring