Ticket/11295 smaller

Smaller version of #1168.