variables renaming and few other details