I have simplified this method to do only what it needs to for the query builder. I moved the extra logic back to the command.