(refactor) Fix status calculation