Remove empty destructors
Use nullptr whether possible
Refactoring and coding style fixes
Fix foreach coding style, add const whether needed