refactor extraction