Getting rid of hasOwnProperty