refactored and edited params as private method