minor refactoring of lib/tag_expressions.rb