Add optional class for reference types