refactor methods using instance variables