Use Angular app namespace and extract out total value method