refactored null checks
corrected
simplified
Merge pull request #5 from alexanderbeletsky/master

Simplified input/format check