Code cleanup for ciao2