refactor setter method