Added background operations and signal handling.