re-arrange code follow High Cohesion.