Refactor card class