Test code refactoring, trying to add better coverage of safe and unsafe impls