Codacy fixes - use the right API from non-optional fields