refactor out use of instance variable