License and code cleanup