DRY up creation of getters and setters