Code cleanup and new license