Advantage of the ChatGPT is that, it takes your command after the initial code suggestion. I tried like, extract logic from the render function, keep function as simple as possible and it will refactor