Refactor cal exc tomake more readable