Clean select and id syntax
add select apply syntax, flatMap