Refactired test