Updated docs, extended unit tests, refactors