Refactored to only use factories