Removed duplications from test logic