Adapter, command and factory pattern