Some refactoring on the script command and structure of files