refactoring writing accessors