Issue 4

Reduced casting toLowerCase()
separate one complicated IF to 2 IFs