finish implement state-pattern