added polymorphism and moved files