add factory method pattern and prototype pattern