Refactoring main test