add esstore and refactoring.