Adding State pattern