cards controller refactor