Refactor Formatter and ResultDistributor classes

- Make them throw exception not return null
Merge pull request #275 from takahi-i/replace-return-null

Refactor Formatter and ResultDistributor classes