refinement: start to seperate logic.