a simple demo of factory method pattern.