Prettifying code, for readability.
Major code restructuring for angular app.