refactor
extract method