extract classes as files
cleanupo code
possible null reference xception
Merge pull request #1 from stanislavromanov/master

Optimized code a bit, usinjg linq, converting to var, null exceptions etc..