write blog about factory method pattern