clean code and add CountdownEvent instead of my own buggy personnal implementation of it