Cleanup code, ready for distribution