[Test] Refactored tests in parts of library