refactoring of the scripts libraries