refactor first case