Apply Factory & Command pattern to encapsulation commands from user