Reorganize illegible code