Added Factory design pattern for creation of clients