updated documentation, very  minor refactors