added explanations about factory design pattern