refactor partial to one if and passed local variable instead of objects