add delete link. refactor and clean code.