changing structure, cleaning code