Remove use of [].forEach and Date.now