Refactoring for tests
Adding tests and docs
Added more tests for pretty