ended despaghettizing code