refactoring and updating scripts for amex, nasdaq and nyse