Added docs to shared classes, +minor refactorings