Generic object creation method