Code structure changces

Following https://github.com/johnpapa/angularjs-styleguide
Merge pull request #1 from salvin/CodeStyleImprovements

Code structure changces