Experimented a bit with exceptions and unique_ptr.