:car: refactored code with test cal