1st code review:
 - fixing missing modifier 'final',
 - fixing or adding copyright header
 - improving few loops
 - closing few streams
 - improving Transformer usage
 - adding TODO