minor c++ification
more constness and use bool for boolean return