Add stat trackings and update code conventions