refactor + first opt