replace all the Object.keys().length with this.isEmpty function