stats: code cleaning