Final sorting of spaghetti code.