Code cleaning.
Cleaner, more logical state machine. Chunk are closed.