refactoring for ccard