Es6 refactor