cleanup and add missing license headers