1.extract function into component