Implemented command pattern.