simplify shared methods;
change controller function to app.controller syntax;
to chain all calls;
fix style;