move stat to separate file