Fixed crash caused by non-public classes

Inspection encouraged removing publc declaration, but it is soo wrong