Command execution refactor