refactor
add editing support