use empty? method rather than asserting equal to empty string
Move decision code into a module