message factory static class to singleton class.