De-spaghetized code