Implemented command & factory patterns.