[refactor] removed toString() from type to avoid nullPointerExceptions