moved object creation to its own class