change some argument from pointer to structure in inner functions