Add more documentation and more "const-correctness"