refactor the code, to remote static functions of mempool