Refactored using angularjs-styleguide