Refactoring createObservable function
Refactoring createObservable function