merge minor code cleanup and license file from master branch