make class optional for injectProperties method