Improved command preparation

Used prepareCommand() from Command
Added test procedure