add factory method pattern.
add singleton pattern and command pattern.