Flood signal handling added
Refactored signal handlers (more type safety)