This maintains the type information which can be used for enforce const-correctness and also for implementing more advanced ways of handling the type information.
clang-tidy was used for fixing the warnings. It is not clear if this is actually an improvement so this may still be disabled later.