refactored scripts and added named log to unit-test