replaced methods with es6 syntax