Use getter to replace public field access