split step1_2() into 3 funcs