subquery expression refactoring, work in progress