res calc cleanup