Refactored est and spent calc functions