rework sh scripts in preporation for production use