refactored to make reconcile a class