Use reader methods instead of instance variables.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>