Improve tests
Use smart pointers