change obsoleted attr to attr_accessor/attr_reader