Best practices refactoring

See: https://github.com/johnpapa/angularjs-styleguide