Added documentation for tests, refactoring

Added documentation, removed duplicated empty rows, formatting