Refactor FROM generation to use helper method
Add having node