converted service to a factory. Moved all JSON manual setting to factory. More structure.