improved get/set of fields, refactoring