refactored to remove $scope and this
added some files