e-command code refactoring