API code refactor - Chapter 13