This is a blind guess here, but if you need to inspect the inner data of your function after writing it, it might mean the scope is too broad and your function could be split?
This is where standard SWE guidelines could be of help (function interfaces, contracts definition, etc)
This is where standard SWE guidelines could be of help (function interfaces, contracts definition, etc)