refactor cards