minor refactor and added ng-hide to hide if data empty