refactor first part