Rewritten using prototype pattern