Refactoring, smart pointers, optimisations.