working on Factory pattern