Writing a class to handle the card view.