improve scripts for output formatting