use sprintf instead of str_replace
for control-structure optimizations
path fixes
QA
increased coverage