dev, more improvements of the code after the latest pull request try, according to the feedback we were given