commands handler ported from quadro project