continued refactoring of the BDQL parsing logic