Add logging and small refactoring
Apache common-io was added
Replace tabs to whitespaces.
P.S. I'm going to hell because of this commit.