add create feature
refactor common code