Replacing mattr_accessor with defined methods