omitting compiler warnings by sticking to RAII