Refactored commands related machinery