Add the logic whether the status of the memo is collision.
and code refactoring.