Tests refactor