Fork option, write pid file, refactoring (esp. braces).