change when to factory method, do not use 'new'