Cleaner way for replacing the commandmanager
Simplified and improved ASM code