finish refactor codes in add & edit author