refactor the chapter8 protected fields and methods