stats: a bit of code cleaning and text formating/restriction