Merge pull request #351 from apache/refactoring/350-Clean-up-and-modernize-code

Issue #350: Clean up and modernize code