Refactor spec helper methods using instance variables