extract methods

extract creation of command and exceptions handlers