@DixitMani1 Refactor so each function is working at a single level of abstraction, avoid excessive layers of nesting, choose parameters to minimize dependencies between functions and maximize reuse, follow established patterns, and name things sensibly.
@DixitMani1 Oh and at a bare minimum, remove any dead code (unreferenced and/or commented out), fix any warnings, and run your team's formatter to clean up whitespace