replaced hardcoded card types with constants

replaced hardcoded card types with constants as well as additional check for empty content: item.getContent() == null || item.getContent().isEmpty()