some cosmetic changes (typos in documentation, types refined)