use params hash instead of instance variable