formatting and removing excess scripts