A little more refactoring. Added support for notted and grouped expressions.