Refactoring tests. Fixing code style.