Remove primitive types and made exception optional