removing unnecessary dtors and moving more objects to use RAII