making a separate search tree factory class