Cleanup

Signed-off-by: Kiril Nesenko <nesenko@gmail.com>
Imporve cleanup and driving alg.

Signed-off-by: Kiril Nesenko <nesenko@gmail.com>