implement smart case (issue #20)