Added new source for daemon thread, shutdown hooks and etc.