Removing duplicate unit test logic