Code cleanup & docu