code cleanup and license update