some utility methods and const-correctness