add simple factory pattern