Refactor accessors.rb