Refactored a bit
ES6 looks funky