Clean up code moved up in tests
Merge pull request #1120 from sshveta/cleanup

Clean up code moved up in tests