factored out an Observable function.