replace my fnamebody by basename from std lib
some cosmetics and formatting