some cleanup and copyright