this should be defined as a service and injected in the constructor.