Refactored to include helper tests