Debug code added to commands
Reduce number of allocations
Remove unused code