Refactor extract method.