refactor server/main and fix force-kill instruments issues