slightly optimize things (don't use hasOwnProperty when possible)