change Factory Pattern using abstract Class