refactor and add edit item list function