moved daemon spawning into a separate function
moved daemon spawning into a separate function

realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core