refactor tracking calcs