refactor group list logic & edit group logic