structured the code