use functional style of declaring ng factories and controllers