Refactor: use getter instead of ivars