Some refactoring to prepare for non-POD types