Use plain for loops instead of for...in for ES5 compatibility