- Clean shutdown if daemon is killed - Prevent daemon from running twice - Minor code cleanup and refactoring