It would be helpful if you could first outline the details of your post. Recently there’s been a string of threads asking for improvements to code and just posting everything without acknowledging that the most important part of a review is context. Please see our category guidelines.
Terminology like “stand” is unclear - I don’t know what this means. I also don’t know what your code is intended to do or what it is for and even just reading it only gives me a vague understanding of what you want and in what way you’re looking for improvements. What dissatisfies you?