ES-4: Refactors the command handling into own class.