use hasOwnProperty instead of `in` because `in` is slow