working modular create_obj func