decomposing procedures to smaller ones and clean up