added const to non modifying methods; other improvements