killbill-uncached

Merge branch 'usage'

4/5/2014 4:37:48 PM

Changes

beatrix/pom.xml 18(+15 -3)

entitlement/src/test/resources/catalog.xml 828(+0 -828)

invoice/pom.xml 5(+5 -0)

junction/src/test/resources/catalog.xml 828(+0 -828)

pom.xml 2(+1 -1)

server/bitcoin.log 1037(+1037 -0)

server/pom.xml 6(+6 -0)

server/src/test/resources/catalog-weapons.xml 641(+0 -641)

subscription/src/test/resources/testInput.xml 828(+0 -828)

Details

diff --git a/.idea/copyright/apache.xml b/.idea/copyright/apache.xml
index d5736cd..ea0fa86 100644
--- a/.idea/copyright/apache.xml
+++ b/.idea/copyright/apache.xml
@@ -1,6 +1,6 @@
 <component name="CopyrightManager">
   <copyright>
-    <option name="notice" value="Copyright 2010-&amp;#36;today.year Ning, Inc.&#10;&#10;Ning licenses this file to you under the Apache License, version 2.0&#10;(the &quot;License&quot;); you may not use this file except in compliance with the&#10;License.  You may obtain a copy of the License at:&#10;&#10;   http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT&#10;WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the&#10;License for the specific language governing permissions and limitations&#10;under the License." />
+    <option name="notice" value="Copyright &amp;#36;today.year The Billing Project, LLC&#10;&#10;The Billing Project licenses this file to you under the Apache License, version 2.0&#10;(the &quot;License&quot;); you may not use this file except in compliance with the&#10;License.  You may obtain a copy of the License at:&#10;&#10;   http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT&#10;WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the&#10;License for the specific language governing permissions and limitations&#10;under the License." />
     <option name="keyword" value="Copyright" />
     <option name="allowReplaceKeyword" value="" />
     <option name="myName" value="apache" />
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 0e574ab..e0ce11c 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -20,8 +20,6 @@
     <inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
       <option name="REPORT_VARIABLES" value="true" />
       <option name="REPORT_PARAMETERS" value="true" />
-      <option name="REPORT_CATCH_PARAMETERS" value="true" />
-      <option name="REPORT_FOREACH_PARAMETERS" value="true" />
     </inspection_tool>
     <inspection_tool class="MagicNumber" enabled="true" level="WARNING" enabled_by_default="true" />
     <inspection_tool class="MissortedModifiers" enabled="true" level="WARNING" enabled_by_default="true">
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 21e6df3..7d9bd7c 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -7,6 +7,7 @@
       <module fileurl="file://$PROJECT_DIR$/beatrix/killbill-beatrix.iml" filepath="$PROJECT_DIR$/beatrix/killbill-beatrix.iml" />
       <module fileurl="file://$PROJECT_DIR$/catalog/killbill-catalog.iml" filepath="$PROJECT_DIR$/catalog/killbill-catalog.iml" />
       <module fileurl="file://$PROJECT_DIR$/currency/killbill-currency.iml" filepath="$PROJECT_DIR$/currency/killbill-currency.iml" />
+      <module fileurl="file://$PROJECT_DIR$/currency/killbill-currency.iml" filepath="$PROJECT_DIR$/currency/killbill-currency.iml" />
       <module fileurl="file://$PROJECT_DIR$/entitlement/killbill-entitlement.iml" filepath="$PROJECT_DIR$/entitlement/killbill-entitlement.iml" />
       <module fileurl="file://$PROJECT_DIR$/api/killbill-internal-api.iml" filepath="$PROJECT_DIR$/api/killbill-internal-api.iml" />
       <module fileurl="file://$PROJECT_DIR$/invoice/killbill-invoice.iml" filepath="$PROJECT_DIR$/invoice/killbill-invoice.iml" />
diff --git a/api/src/main/java/org/killbill/billing/glue/InvoiceModule.java b/api/src/main/java/org/killbill/billing/glue/InvoiceModule.java
index ed46527..e782366 100644
--- a/api/src/main/java/org/killbill/billing/glue/InvoiceModule.java
+++ b/api/src/main/java/org/killbill/billing/glue/InvoiceModule.java
@@ -18,11 +18,11 @@ package org.killbill.billing.glue;
 
 public interface InvoiceModule {
 
-    public abstract void installInvoiceUserApi();
+    public void installInvoiceUserApi();
 
-    public abstract void installInvoicePaymentApi();
+    public void installInvoicePaymentApi();
 
-    public abstract void installInvoiceMigrationApi();
+    public void installInvoiceMigrationApi();
 
-    public abstract void installInvoiceInternalApi();
+    public void installInvoiceInternalApi();
 }
diff --git a/api/src/main/java/org/killbill/billing/junction/BillingEvent.java b/api/src/main/java/org/killbill/billing/junction/BillingEvent.java
index a916829..cfc0ea4 100644
--- a/api/src/main/java/org/killbill/billing/junction/BillingEvent.java
+++ b/api/src/main/java/org/killbill/billing/junction/BillingEvent.java
@@ -17,15 +17,18 @@
 package org.killbill.billing.junction;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 
 import org.killbill.billing.account.api.Account;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.killbill.billing.catalog.api.BillingPeriod;
 import org.killbill.billing.catalog.api.Currency;
 import org.killbill.billing.catalog.api.Plan;
 import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Usage;
 import org.killbill.billing.subscription.api.SubscriptionBaseTransitionType;
 import org.killbill.billing.subscription.api.SubscriptionBase;
 
@@ -71,7 +74,7 @@ public interface BillingEvent extends Comparable<BillingEvent> {
     /**
      * @return the billing mode for the current event
      */
-    public BillingModeType getBillingMode();
+    public BillingMode getBillingMode();
 
     /**
      * @return the description of the billing event
@@ -104,7 +107,13 @@ public interface BillingEvent extends Comparable<BillingEvent> {
     public Long getTotalOrdering();
 
     /**
-     * @return The TimeZone of the account
+     * @return the TimeZone of the account
      */
     public DateTimeZone getTimeZone();
+
+    /**
+     *
+     * @return the list of {@code Usage} section
+     */
+    public List<Usage> getUsages();
 }
diff --git a/api/src/main/java/org/killbill/billing/junction/BillingEventSet.java b/api/src/main/java/org/killbill/billing/junction/BillingEventSet.java
index bfdbb0a..432ecb5 100644
--- a/api/src/main/java/org/killbill/billing/junction/BillingEventSet.java
+++ b/api/src/main/java/org/killbill/billing/junction/BillingEventSet.java
@@ -17,12 +17,20 @@
 package org.killbill.billing.junction;
 
 import java.util.List;
+import java.util.Map;
 import java.util.SortedSet;
 import java.util.UUID;
 
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Usage;
+
 public interface BillingEventSet extends SortedSet<BillingEvent> {
 
-    public abstract boolean isAccountAutoInvoiceOff();
+    public boolean isAccountAutoInvoiceOff();
+
+    public BillingMode getRecurringBillingMode();
+
+    public List<UUID> getSubscriptionIdsWithAutoInvoiceOff();
 
-    public abstract List<UUID> getSubscriptionIdsWithAutoInvoiceOff();
+    public Map<String, Usage> getUsages();
 }
diff --git a/api/src/main/java/org/killbill/billing/junction/BillingInternalApi.java b/api/src/main/java/org/killbill/billing/junction/BillingInternalApi.java
index 614b32f..f8cda97 100644
--- a/api/src/main/java/org/killbill/billing/junction/BillingInternalApi.java
+++ b/api/src/main/java/org/killbill/billing/junction/BillingInternalApi.java
@@ -18,6 +18,9 @@ package org.killbill.billing.junction;
 
 import java.util.UUID;
 
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.LocalDate;
 import org.killbill.billing.callcontext.InternalCallContext;
 
 public interface BillingInternalApi {

beatrix/pom.xml 18(+15 -3)

diff --git a/beatrix/pom.xml b/beatrix/pom.xml
index ce94bd8..b1b166c 100644
--- a/beatrix/pom.xml
+++ b/beatrix/pom.xml
@@ -88,6 +88,12 @@
         </dependency>
         <dependency>
             <groupId>org.kill-bill.billing</groupId>
+            <artifactId>killbill-catalog</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.kill-bill.billing</groupId>
             <artifactId>killbill-currency</artifactId>
         </dependency>
         <dependency>
@@ -167,6 +173,12 @@
         </dependency>
         <dependency>
             <groupId>org.kill-bill.billing</groupId>
+            <artifactId>killbill-usage</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.kill-bill.billing</groupId>
             <artifactId>killbill-util</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
@@ -234,9 +246,9 @@
                         </goals>
                         <configuration>
                             <tasks>
-                                <copy file="${basedir}/../osgi-bundles/tests/beatrix/target/killbill-osgi-bundles-test-beatrix-${project.version}-jar-with-dependencies.jar" tofile="${basedir}/src/test/resources/killbill-osgi-bundles-test-beatrix-${project.version}-jar-with-dependencies.jar" />
-                                <copy file="${basedir}/../osgi-bundles/tests/payment/target/killbill-osgi-bundles-test-payment-${project.version}-jar-with-dependencies.jar" tofile="${basedir}/src/test/resources/killbill-osgi-bundles-test-payment-${project.version}-jar-with-dependencies.jar" />
-                                <copy file="${basedir}/../osgi-bundles/bundles/jruby/target/killbill-osgi-bundles-jruby-${project.version}.jar" tofile="${basedir}/src/test/resources/killbill-osgi-bundles-jruby-${project.version}.jar" />
+                                <copy file="${basedir}/../osgi-bundles/tests/beatrix/target/killbill-osgi-bundles-test-beatrix-${project.version}-jar-with-dependencies.jar" tofile="${basedir}/src/test/resources/killbill-osgi-bundles-test-beatrix-${project.version}-jar-with-dependencies.jar"></copy>
+                                <copy file="${basedir}/../osgi-bundles/tests/payment/target/killbill-osgi-bundles-test-payment-${project.version}-jar-with-dependencies.jar" tofile="${basedir}/src/test/resources/killbill-osgi-bundles-test-payment-${project.version}-jar-with-dependencies.jar"></copy>
+                                <copy file="${basedir}/../osgi-bundles/bundles/jruby/target/killbill-osgi-bundles-jruby-${project.version}.jar" tofile="${basedir}/src/test/resources/killbill-osgi-bundles-jruby-${project.version}.jar"></copy>
                             </tasks>
                         </configuration>
                     </execution>
diff --git a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/BeatrixIntegrationModule.java b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/BeatrixIntegrationModule.java
index 71571d8..eea3f8c 100644
--- a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/BeatrixIntegrationModule.java
+++ b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/BeatrixIntegrationModule.java
@@ -54,6 +54,7 @@ import org.killbill.billing.payment.provider.MockPaymentProviderPluginModule;
 import org.killbill.billing.subscription.api.SubscriptionBaseService;
 import org.killbill.billing.subscription.glue.DefaultSubscriptionModule;
 import org.killbill.billing.tenant.glue.TenantModule;
+import org.killbill.billing.usage.glue.TestUsageModule;
 import org.killbill.billing.usage.glue.UsageModule;
 import org.killbill.billing.util.config.PaymentConfig;
 import org.killbill.billing.util.email.EmailModule;
@@ -114,13 +115,13 @@ public class BeatrixIntegrationModule extends AbstractModule {
         install(new IntegrationTestOverdueModule(configSource));
         install(new AuditModule());
         install(new CurrencyModule(configSource));
-        install(new UsageModule(configSource));
         install(new TenantModule(configSource));
         install(new ExportModule());
         install(new DefaultOSGIModule(configSource));
         install(new NonEntityDaoModule());
         install(new RecordIdModule());
         install(new BeatrixModuleWithSubsetLifecycle(configSource));
+        install(new UsageModule(configSource));
 
         bind(AccountChecker.class).asEagerSingleton();
         bind(SubscriptionChecker.class).asEagerSingleton();
diff --git a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestBundleTransfer.java b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestBundleTransfer.java
index 5323585..ec7a677 100644
--- a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestBundleTransfer.java
+++ b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestBundleTransfer.java
@@ -72,7 +72,7 @@ public class TestBundleTransfer extends TestIntegrationBase {
         assertNotNull(bpEntitlement);
 
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvent(NextEvent.PHASE);
@@ -123,7 +123,7 @@ public class TestBundleTransfer extends TestIntegrationBase {
         assertListenerStatus();
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvent(NextEvent.PHASE);
@@ -182,7 +182,7 @@ public class TestBundleTransfer extends TestIntegrationBase {
         assertListenerStatus();
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvent(NextEvent.PHASE);
diff --git a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegration.java b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegration.java
index 4c51694..d3e7445 100644
--- a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegration.java
+++ b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegration.java
@@ -503,7 +503,7 @@ public class TestIntegration extends TestIntegrationBase {
         //
         DefaultSubscriptionBase subscription = (DefaultSubscriptionBase) baseEntitlement.getSubscriptionBase();
         final DateTime startDate = subscription.getCurrentPhaseStart();
-        final BigDecimal rate = subscription.getCurrentPhase().getFixedPrice().getPrice(Currency.USD);
+        final BigDecimal rate = subscription.getCurrentPhase().getFixed().getPrice().getPrice(Currency.USD);
         verifyTestResult(accountId, subscription.getId(), startDate, null, rate, clock.getUTCNow(), 1);
 
         //
diff --git a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationBase.java b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationBase.java
index 4f52701..3a14ae9 100644
--- a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationBase.java
+++ b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationBase.java
@@ -29,6 +29,7 @@ import javax.inject.Named;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 import org.joda.time.LocalDate;
+import org.killbill.billing.usage.api.UsageUserApi;
 import org.skife.jdbi.v2.IDBI;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -188,6 +189,9 @@ public class TestIntegrationBase extends BeatrixTestSuiteWithEmbeddedDB {
     protected AccountInternalApi accountInternalApi;
 
     @Inject
+    protected UsageUserApi usageUserApi;
+
+    @Inject
     protected OSGIConfig osgiConfig;
 
     @Inject
diff --git a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationInvoiceWithRepairLogic.java b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationInvoiceWithRepairLogic.java
index 58e0dbd..bc1f0f4 100644
--- a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationInvoiceWithRepairLogic.java
+++ b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationInvoiceWithRepairLogic.java
@@ -398,7 +398,7 @@ public class TestIntegrationInvoiceWithRepairLogic extends TestIntegrationBase {
 
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
@@ -416,7 +416,7 @@ public class TestIntegrationInvoiceWithRepairLogic extends TestIntegrationBase {
         //
         bpEntitlement = changeEntitlementAndCheckForCompletion(bpEntitlement, productName, BillingPeriod.MONTHLY, BillingActionPolicy.IMMEDIATE, NextEvent.CHANGE, NextEvent.INVOICE, NextEvent.INVOICE_ADJUSTMENT);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         invoices = invoiceUserApi.getInvoicesByAccount(account.getId(), callContext);
         assertEquals(invoices.size(), 3);
@@ -504,7 +504,7 @@ public class TestIntegrationInvoiceWithRepairLogic extends TestIntegrationBase {
         assertNotNull(bpEntitlement);
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
@@ -580,7 +580,7 @@ public class TestIntegrationInvoiceWithRepairLogic extends TestIntegrationBase {
         assertNotNull(bpEntitlement);
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
diff --git a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationWithDifferentBillingPeriods.java b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationWithDifferentBillingPeriods.java
index 491d18d..74bfe42 100644
--- a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationWithDifferentBillingPeriods.java
+++ b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestIntegrationWithDifferentBillingPeriods.java
@@ -62,7 +62,7 @@ public class TestIntegrationWithDifferentBillingPeriods extends TestIntegrationB
         assertNotNull(bpEntitlement);
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
@@ -117,7 +117,7 @@ public class TestIntegrationWithDifferentBillingPeriods extends TestIntegrationB
         assertNotNull(bpEntitlement);
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
@@ -186,7 +186,7 @@ public class TestIntegrationWithDifferentBillingPeriods extends TestIntegrationB
         assertNotNull(bpEntitlement);
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
@@ -256,7 +256,7 @@ public class TestIntegrationWithDifferentBillingPeriods extends TestIntegrationB
         assertNotNull(bpEntitlement);
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
diff --git a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestSubscription.java b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestSubscription.java
index d26e5b9..da39b52 100644
--- a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestSubscription.java
+++ b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/TestSubscription.java
@@ -62,7 +62,7 @@ public class TestSubscription extends TestIntegrationBase {
         assertNotNull(bpEntitlement);
         assertEquals(invoiceUserApi.getInvoicesByAccount(account.getId(), callContext).size(), 1);
 
-        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(bpEntitlement.getSubscriptionBase().getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         // Move out of trials for interesting invoices adjustments
         busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
diff --git a/beatrix/src/test/java/org/killbill/billing/beatrix/integration/usage/TestConsumableInArrear.java b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/usage/TestConsumableInArrear.java
new file mode 100644
index 0000000..84f8329
--- /dev/null
+++ b/beatrix/src/test/java/org/killbill/billing/beatrix/integration/usage/TestConsumableInArrear.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.beatrix.integration.usage;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.LocalDate;
+import org.killbill.billing.account.api.Account;
+import org.killbill.billing.account.api.AccountData;
+import org.killbill.billing.api.TestApiListener.NextEvent;
+import org.killbill.billing.beatrix.integration.TestIntegrationBase;
+import org.killbill.billing.beatrix.util.InvoiceChecker.ExpectedInvoiceItemCheck;
+import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.ProductCategory;
+import org.killbill.billing.entitlement.api.DefaultEntitlement;
+import org.killbill.billing.invoice.api.InvoiceItemType;
+import org.killbill.billing.usage.api.RolledUpUsage;
+import org.killbill.billing.usage.api.UsageUserApi;
+import org.killbill.billing.usage.api.user.DefaultRolledUpUsage;
+import org.killbill.billing.usage.api.user.MockUsageUserApi;
+import org.killbill.billing.util.callcontext.CallContext;
+import org.killbill.billing.util.callcontext.TenantContext;
+import org.mockito.Mockito;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+
+public class TestConsumableInArrear extends TestIntegrationBase {
+
+    @BeforeMethod(groups = "slow")
+    public void beforeMethod() throws Exception {
+        super.beforeMethod();
+    }
+
+    protected UsageUserApi createMockUsageUserApi(final List<RolledUpUsage> returnValue) {
+        final UsageUserApi result = Mockito.mock(UsageUserApi.class);
+        Mockito.when(result.getAllUsageForSubscription(Mockito.<UUID>any(), Mockito.<Set<String>>any(), Mockito.<List<DateTime>>any(), Mockito.<TenantContext>any())).thenReturn(returnValue);
+        return result;
+    }
+
+    @Test(groups = "slow")
+    public void testSimple() throws Exception {
+
+
+        final AccountData accountData = getAccountData(1);
+        final Account account = createAccountWithNonOsgiPaymentMethod(accountData);
+        accountChecker.checkAccount(account.getId(), accountData, callContext);
+
+        // We take april as it has 30 days (easier to play with BCD)
+        // Set clock to the initial start date - we implicitly assume here that the account timezone is UTC
+        clock.setDay(new LocalDate(2012, 4, 1));
+
+        //
+        // CREATE SUBSCRIPTION AND EXPECT BOTH EVENTS: NextEvent.CREATE NextEvent.INVOICE
+        //
+        final DefaultEntitlement bpSubscription = createBaseEntitlementAndCheckForCompletion(account.getId(), "bundleKey", "Shotgun", ProductCategory.BASE, BillingPeriod.ANNUAL, NextEvent.CREATE, NextEvent.INVOICE);
+        // Check bundle after BP got created otherwise we get an error from auditApi.
+        subscriptionChecker.checkSubscriptionCreated(bpSubscription.getId(), internalCallContext);
+        invoiceChecker.checkInvoice(account.getId(), 1, callContext, new ExpectedInvoiceItemCheck(new LocalDate(2012, 4, 1), null, InvoiceItemType.FIXED, new BigDecimal("0")));
+
+
+        //
+        // ADD ADD_ON ON THE SAME DAY
+        //
+        final DefaultEntitlement aoSubscription = addAOEntitlementAndCheckForCompletion(bpSubscription.getBundleId(), "Bullets", ProductCategory.ADD_ON, BillingPeriod.NO_BILLING_PERIOD, NextEvent.CREATE);
+
+        setUsage(aoSubscription.getId(), "bullets", new DateTime(2012, 4, 1, 1, 1, DateTimeZone.UTC), new DateTime(2012, 4, 15, 0, 0, DateTimeZone.UTC), new BigDecimal("99"), callContext);
+        setUsage(aoSubscription.getId(), "bullets", new DateTime(2012, 4, 15, 0, 0, DateTimeZone.UTC), new DateTime(2012, 4, 20, 1, 1, DateTimeZone.UTC), new BigDecimal("100"), callContext);
+
+        busHandler.pushExpectedEvents(NextEvent.PHASE, NextEvent.INVOICE, NextEvent.PAYMENT);
+        clock.setDay(new LocalDate(2012, 5, 1));
+        assertListenerStatus();
+
+        invoiceChecker.checkInvoice(account.getId(), 2, callContext,
+                                    new ExpectedInvoiceItemCheck(new LocalDate(2012, 5, 1), new LocalDate(2013, 5, 1), InvoiceItemType.RECURRING, new BigDecimal("2399.95")),
+                                    new ExpectedInvoiceItemCheck(new LocalDate(2012, 4, 1), new LocalDate(2012, 5, 1), InvoiceItemType.USAGE, new BigDecimal("5.90")));
+
+
+        busHandler.pushExpectedEvents(NextEvent.INVOICE);
+        clock.setDay(new LocalDate(2012, 6, 1));
+        assertListenerStatus();
+
+        invoiceChecker.checkInvoice(account.getId(), 3, callContext,
+                                    new ExpectedInvoiceItemCheck(new LocalDate(2012, 5, 1), new LocalDate(2012, 6, 1), InvoiceItemType.USAGE, BigDecimal.ZERO));
+
+
+        setUsage(aoSubscription.getId(), "bullets", new DateTime(2012, 6, 1, 1, 1, DateTimeZone.UTC), new DateTime(2012, 6, 15, 1, 1, DateTimeZone.UTC), new BigDecimal("50"), callContext);
+        setUsage(aoSubscription.getId(), "bullets", new DateTime(2012, 6, 16, 1, 1, DateTimeZone.UTC), new DateTime(2012, 6, 20, 1, 1, DateTimeZone.UTC), new BigDecimal("300"), callContext);
+
+
+        busHandler.pushExpectedEvents(NextEvent.INVOICE, NextEvent.PAYMENT);
+        clock.setDay(new LocalDate(2012, 7, 1));
+        assertListenerStatus();
+
+        invoiceChecker.checkInvoice(account.getId(), 4, callContext,
+                                    new ExpectedInvoiceItemCheck(new LocalDate(2012, 6, 1), new LocalDate(2012, 7, 1), InvoiceItemType.USAGE, new BigDecimal("11.80")));
+
+    }
+
+    private void setUsage(final UUID subscriptionId, final String unitType, final DateTime startTime, final DateTime endTime, final BigDecimal amount, final CallContext context) {
+        usageUserApi.recordRolledUpUsage(subscriptionId, unitType, startTime, endTime, amount, context);
+    }
+}
diff --git a/beatrix/src/test/resources/beatrix.properties b/beatrix/src/test/resources/beatrix.properties
index 475ad09..acc60b4 100644
--- a/beatrix/src/test/resources/beatrix.properties
+++ b/beatrix/src/test/resources/beatrix.properties
@@ -1,3 +1,3 @@
-org.killbill.catalog.uri=file:src/test/resources/catalogSample.xml
+org.killbill.catalog.uri=catalogTest.xml
 org.killbill.payment.retry.days=8,8,8,8,8,8,8,8
 org.killbill.osgi.bundle.install.dir=/var/tmp/beatrix-bundles
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultBlock.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultBlock.java
new file mode 100644
index 0000000..14a73ec
--- /dev/null
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultBlock.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlIDREF;
+
+import org.killbill.billing.ErrorCode;
+import org.killbill.billing.catalog.api.Block;
+import org.killbill.billing.catalog.api.BlockType;
+import org.killbill.billing.catalog.api.CatalogApiException;
+import org.killbill.billing.catalog.api.InternationalPrice;
+import org.killbill.billing.catalog.api.Unit;
+import org.killbill.billing.util.config.catalog.ValidatingConfig;
+import org.killbill.billing.util.config.catalog.ValidationError;
+import org.killbill.billing.util.config.catalog.ValidationErrors;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class DefaultBlock extends ValidatingConfig<StandaloneCatalog> implements Block {
+
+    @XmlAttribute(required = false)
+    private BlockType type = BlockType.VANILLA;
+
+    @XmlElement(required = true)
+    @XmlIDREF
+    private DefaultUnit unit;
+
+    @XmlElement(required = true)
+    private Double size;
+
+    @XmlElement(required = true)
+    private DefaultInternationalPrice prices;
+
+    @XmlElement(required = false)
+    private Double minTopUpCredit;
+
+    // Not defined in catalog
+    private DefaultUsage usage;
+
+    @Override
+    public BlockType getType() {
+        return type;
+    }
+
+    @Override
+    public Unit getUnit() {
+        return unit;
+    }
+
+    @Override
+    public Double getSize() {
+        return size;
+    }
+
+    @Override
+    public InternationalPrice getPrice() {
+        return prices;
+    }
+
+    @Override
+    public Double getMinTopUpCredit() throws CatalogApiException {
+        if (type != BlockType.TOP_UP) {
+            throw new CatalogApiException(ErrorCode.CAT_NOT_TOP_UP_BLOCK, usage.getPhase().getName());
+        }
+        return minTopUpCredit;
+    }
+
+    @Override
+    public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
+        if (type == BlockType.TOP_UP && minTopUpCredit == null) {
+            errors.add(new ValidationError(String.format("TOP_UP block needs to define minTopUpCredit for phase %s",
+                                                         usage.getPhase().toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        return errors;
+    }
+
+    public DefaultBlock setType(final BlockType type) {
+        this.type = type;
+        return this;
+    }
+
+    public DefaultBlock setPrices(final DefaultInternationalPrice prices) {
+        this.prices = prices;
+        return this;
+    }
+
+    public DefaultBlock setUnit(final DefaultUnit unit) {
+        this.unit = unit;
+        return this;
+    }
+
+    public DefaultBlock setSize(final Double size) {
+        this.size = size;
+        return this;
+    }
+
+    public DefaultBlock setPrice(final DefaultInternationalPrice prices) {
+        this.prices = prices;
+        return this;
+    }
+
+    public DefaultBlock setUsage(final DefaultUsage usage) {
+        this.usage = usage;
+        return this;
+    }
+}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultFixed.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultFixed.java
new file mode 100644
index 0000000..1d0345b
--- /dev/null
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultFixed.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * The Billing Project licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import java.net.URI;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+import org.killbill.billing.catalog.api.Fixed;
+import org.killbill.billing.catalog.api.FixedType;
+import org.killbill.billing.catalog.api.InternationalPrice;
+import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.util.config.catalog.ValidatingConfig;
+import org.killbill.billing.util.config.catalog.ValidationErrors;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class DefaultFixed extends ValidatingConfig<StandaloneCatalog> implements Fixed {
+
+
+    @XmlAttribute(required = false)
+    private FixedType type = FixedType.ONE_TIME;
+
+    @XmlElement(required = false)
+    private DefaultInternationalPrice fixedPrice;
+
+    // Not exposed in xml.
+    private PlanPhase phase;
+
+    @Override
+    public FixedType getType() {
+        return type;
+    }
+
+    @Override
+    public InternationalPrice getPrice() {
+        return fixedPrice;
+    }
+
+
+    @Override
+    public void initialize(final StandaloneCatalog root, final URI uri) {
+        if (fixedPrice != null) {
+            fixedPrice.initialize(root, uri);
+        }
+    }
+        @Override
+    public ValidationErrors validate(final StandaloneCatalog root, final ValidationErrors errors) {
+        return errors;
+    }
+
+    protected DefaultFixed setType(final FixedType type) {
+        this.type = type;
+        return this;
+    }
+
+    protected DefaultFixed setFixedPrice(final DefaultInternationalPrice fixedPrice) {
+        this.fixedPrice = fixedPrice;
+        return this;
+    }
+
+    protected DefaultFixed setPhase(final PlanPhase phase) {
+        this.phase = phase;
+        return this;
+    }
+}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultInternationalPrice.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultInternationalPrice.java
index cb3bb49..ed425c7 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultInternationalPrice.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultInternationalPrice.java
@@ -49,6 +49,8 @@ public class DefaultInternationalPrice extends ValidatingConfig<StandaloneCatalo
     }
 
 
+
+
     /* (non-Javadoc)
       * @see org.killbill.billing.catalog.IInternationalPrice#getPrice(org.killbill.billing.catalog.api.Currency)
       */
@@ -62,7 +64,7 @@ public class DefaultInternationalPrice extends ValidatingConfig<StandaloneCatalo
         throw new CatalogApiException(ErrorCode.CAT_NO_PRICE_FOR_CURRENCY, currency);
     }
 
-    protected DefaultInternationalPrice setPrices(final DefaultPrice[] prices) {
+    public DefaultInternationalPrice setPrices(final DefaultPrice[] prices) {
         this.prices = prices;
         return this;
     }
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultLimit.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultLimit.java
index cc7ee58..4f3cd2d 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultLimit.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultLimit.java
@@ -37,7 +37,9 @@ public class DefaultLimit extends ValidatingConfig<StandaloneCatalog> implements
     
     @XmlElement(required = false)
     private Double min;
-    
+
+    // Not defined in catalog
+    private DefaultUsage usage;
     
     /* (non-Javadoc)
      * @see org.killbill.billing.catalog.Limit#getUnit()
@@ -88,4 +90,24 @@ public class DefaultLimit extends ValidatingConfig<StandaloneCatalog> implements
         }
         return true;
     }
+
+    public DefaultLimit setUnit(final DefaultUnit unit) {
+        this.unit = unit;
+        return this;
+    }
+
+    public DefaultLimit setMax(final Double max) {
+        this.max = max;
+        return this;
+    }
+
+    public DefaultLimit setMin(final Double min) {
+        this.min = min;
+        return this;
+    }
+
+    public DefaultLimit setUsage(final DefaultUsage usage) {
+        this.usage = usage;
+        return this;
+    }
 }
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlan.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlan.java
index 85c7fa5..0c4071b 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlan.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlan.java
@@ -39,6 +39,7 @@ import org.killbill.billing.catalog.api.PhaseType;
 import org.killbill.billing.catalog.api.Plan;
 import org.killbill.billing.catalog.api.PlanPhase;
 import org.killbill.billing.catalog.api.Product;
+import org.killbill.billing.catalog.api.Recurring;
 import org.killbill.billing.util.config.catalog.ValidatingConfig;
 import org.killbill.billing.util.config.catalog.ValidationError;
 import org.killbill.billing.util.config.catalog.ValidationErrors;
@@ -142,8 +143,8 @@ public class DefaultPlan extends ValidatingConfig<StandaloneCatalog> implements 
     }
 
     @Override
-    public BillingPeriod getBillingPeriod() {
-        return finalPhase.getBillingPeriod();
+    public BillingPeriod getRecurringBillingPeriod() {
+        return finalPhase.getRecurring() != null ? finalPhase.getRecurring().getBillingPeriod() : BillingPeriod.NO_BILLING_PERIOD;
     }
 
     /* (non-Javadoc)
@@ -191,6 +192,8 @@ public class DefaultPlan extends ValidatingConfig<StandaloneCatalog> implements 
                                            catalog.getCatalogURI(), DefaultInternationalPrice.class, ""));
         }
 
+        validateCollection(catalog, errors, initialPhases);
+        finalPhase.validate(catalog, errors);
         return errors;
     }
 
@@ -246,7 +249,8 @@ public class DefaultPlan extends ValidatingConfig<StandaloneCatalog> implements 
                     skipPhase = false;
                 }
             }
-            if (phase.getRecurringPrice() == null || phase.getRecurringPrice().isZero()) {
+            final Recurring recurring = phase.getRecurring();
+            if (recurring == null || recurring.getRecurringPrice() == null || recurring.getRecurringPrice().isZero()) {
                 result = phase.getDuration().addToDateTime(result);
             } else {
                 break;
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhase.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhase.java
index 142ae9e..ea16bd8 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhase.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhase.java
@@ -25,14 +25,14 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 
 import org.killbill.billing.ErrorCode;
-import org.killbill.billing.catalog.api.BillingPeriod;
 import org.killbill.billing.catalog.api.CatalogApiException;
 import org.killbill.billing.catalog.api.Duration;
-import org.killbill.billing.catalog.api.InternationalPrice;
-import org.killbill.billing.catalog.api.Limit;
+import org.killbill.billing.catalog.api.Fixed;
 import org.killbill.billing.catalog.api.PhaseType;
 import org.killbill.billing.catalog.api.Plan;
 import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Recurring;
+import org.killbill.billing.catalog.api.Usage;
 import org.killbill.billing.util.config.catalog.ValidatingConfig;
 import org.killbill.billing.util.config.catalog.ValidationError;
 import org.killbill.billing.util.config.catalog.ValidationErrors;
@@ -46,22 +46,15 @@ public class DefaultPlanPhase extends ValidatingConfig<StandaloneCatalog> implem
     @XmlElement(required = true)
     private DefaultDuration duration;
 
-    @XmlElement(required = true)
-    private BillingPeriod billingPeriod;
-
     @XmlElement(required = false)
-    private DefaultInternationalPrice recurringPrice;
+    private DefaultFixed fixed;
 
     @XmlElement(required = false)
-    private DefaultInternationalPrice fixedPrice;
+    private DefaultRecurring recurring;
 
-    @XmlElementWrapper(name = "limits", required = false)
-    @XmlElement(name = "limit", required = true)
-    private DefaultLimit[] limits = new DefaultLimit[0];
-
-//  Not supported: variable pricing
-//	@XmlElement(required=false)
-//	private InternationalPrice unitPrice;
+    @XmlElementWrapper(name = "usages", required = false)
+    @XmlElement(name = "usage", required = false)
+    private DefaultUsage[] usages = new DefaultUsage[0];
 
     //Not exposed in XML
     private Plan plan;
@@ -79,42 +72,44 @@ public class DefaultPlanPhase extends ValidatingConfig<StandaloneCatalog> implem
         throw new CatalogApiException(ErrorCode.CAT_BAD_PHASE_NAME, phaseName);
     }
 
-
     /* (non-Javadoc)
-      * @see org.killbill.billing.catalog.IPlanPhase#getRecurringPrice()
+      * @see org.killbill.billing.catalog.IPlanPhase#getCohort()
       */
     @Override
-    public DefaultInternationalPrice getRecurringPrice() {
-        return recurringPrice;
+    public PhaseType getPhaseType() {
+        return type;
     }
 
-    /* (non-Javadoc)
-      * @see org.killbill.billing.catalog.IPlanPhase#getInternationalPrice()
-      */
     @Override
-    public InternationalPrice getFixedPrice() {
-        return fixedPrice;
+    public boolean compliesWithLimits(final String unit, final double value) {
+        // First check usage section
+        for (DefaultUsage usage : usages) {
+            if (!usage.compliesWithLimits(unit, value)) {
+                return false;
+            }
+        }
+        // Second, check if there are limits defined at the product section.
+        return plan.getProduct().compliesWithLimits(unit, value);
     }
 
-    /* (non-Javadoc)
-      * @see org.killbill.billing.catalog.IPlanPhase#getCohort()
-      */
     @Override
-    public PhaseType getPhaseType() {
-        return type;
+    public Fixed getFixed() {
+        return fixed;
     }
 
-    /* (non-Javadoc)
-      * @see org.killbill.billing.catalog.IPlanPhase#getBillCycleDuration()
-      */
     @Override
-    public BillingPeriod getBillingPeriod() {
-        return billingPeriod;
+    public Recurring getRecurring() {
+        return recurring;
+    }
+
+    @Override
+    public Usage[] getUsages() {
+        return usages;
     }
 
     /* (non-Javadoc)
-      * @see org.killbill.billing.catalog.IPlanPhase#getName()
-      */
+          * @see org.killbill.billing.catalog.IPlanPhase#getName()
+          */
     @Override
     public String getName() {
         return phaseName(plan.getName(), this.getPhaseType());
@@ -138,101 +133,59 @@ public class DefaultPlanPhase extends ValidatingConfig<StandaloneCatalog> implem
         return duration;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.killbill.billing.catalog.PlanPhase#getLimit()
-     */
-    @Override
-    public DefaultLimit[] getLimits() {
-        return limits;
-    }
-    
-    
-    protected Limit findLimit(String unit) {
-        for(Limit limit: limits) {
-            if(limit.getUnit().getName().equals(unit) ) {
-                    return limit;
-            }
-        }
-        return null;
-    }
-    
-    
-    @Override
-    public boolean compliesWithLimits(String unit, double value) {
-        Limit l = findLimit(unit);
-        if (l == null) {
-            return getPlan().getProduct().compliesWithLimits(unit, value);
-        }
-        return l.compliesWith(value);
-    }
-
-
     @Override
     public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
-        //Validation: check for nulls
-        if (billingPeriod == null) {
-            errors.add(new ValidationError(String.format("Phase %s of plan %s has a recurring price but no billing period", type.toString(), plan.getName()),
-                                           catalog.getCatalogURI(), DefaultPlanPhase.class, type.toString()));
-        }
-
-        //Validation: if there is a recurring price there must be a billing period
-        if ((recurringPrice != null) && (billingPeriod == null || billingPeriod == BillingPeriod.NO_BILLING_PERIOD)) {
-            errors.add(new ValidationError(String.format("Phase %s of plan %s has a recurring price but no billing period", type.toString(), plan.getName()),
-                                           catalog.getCatalogURI(), DefaultPlanPhase.class, type.toString()));
-        }
-
-        //Validation: if there is no recurring price there should be no billing period
-        if ((recurringPrice == null) && billingPeriod != BillingPeriod.NO_BILLING_PERIOD) {
-            errors.add(new ValidationError(String.format("Phase %s of plan %s has no recurring price but does have a billing period. The billing period should be set to '%s'",
-                                                         type.toString(), plan.getName(), BillingPeriod.NO_BILLING_PERIOD),
-                                           catalog.getCatalogURI(), DefaultPlanPhase.class, type.toString()));
-        }
 
-        //Validation: if there BP is set to NO_BILLING_PERIOD there must be a fixed price
-        if ((billingPeriod == BillingPeriod.NO_BILLING_PERIOD && fixedPrice == null)) {
-            errors.add(new ValidationError(String.format("Phase %s of plan %s has no billing period. It must have a fixed price set.",
+        if (fixed == null && recurring == null && usages.length == 0) {
+            errors.add(new ValidationError(String.format("Phase %s of plan %s need to define at least either a fixed or recurrring or usage section.",
                                                          type.toString(), plan.getName()),
                                            catalog.getCatalogURI(), DefaultPlanPhase.class, type.toString()));
         }
-
-        //Validation: there must be at least one of recurringPrice or fixedPrice
-        if ((recurringPrice == null) && fixedPrice == null) {
-            errors.add(new ValidationError(String.format("Phase %s of plan %s has neither a recurring price or a fixed price.",
-                                                         type.toString(), plan.getName()),
-                                           catalog.getCatalogURI(), DefaultPlanPhase.class, type.toString()));
+        if (fixed != null) {
+            fixed.validate(catalog, errors);
+        }
+        if (recurring != null) {
+            recurring.validate(catalog, errors);
         }
+        validateCollection(catalog, errors, usages);
         return errors;
     }
 
     @Override
     public void initialize(final StandaloneCatalog root, final URI uri) {
-        if (fixedPrice != null) {
-            fixedPrice.initialize(root, uri);
+        if (fixed != null) {
+            fixed.initialize(root, uri);
+            fixed.setPhase(this);
         }
-        if (recurringPrice != null) {
-            recurringPrice.initialize(root, uri);
+        if (recurring != null) {
+            recurring.initialize(root, uri);
+            recurring.setPhase(this);
+        }
+        if (usages != null) {
+            for (DefaultUsage usage : usages) {
+                usage.initialize(root, uri);
+                usage.setPhase(this);
+            }
         }
     }
 
-    protected DefaultPlanPhase setFixedPrice(final DefaultInternationalPrice price) {
-        this.fixedPrice = price;
+    protected DefaultPlanPhase setFixed(final DefaultFixed fixed) {
+        this.fixed = fixed;
         return this;
     }
 
-    protected DefaultPlanPhase setRecurringPrice(final DefaultInternationalPrice price) {
-        this.recurringPrice = price;
+    protected DefaultPlanPhase setRecurring(final DefaultRecurring recurring) {
+        this.recurring = recurring;
         return this;
     }
 
-    protected DefaultPlanPhase setPhaseType(final PhaseType cohort) {
-        this.type = cohort;
+    protected DefaultPlanPhase setUsages(final DefaultUsage []  usages) {
+        this.usages = usages;
         return this;
     }
 
-    protected DefaultPlanPhase setBillingPeriod(final BillingPeriod billingPeriod) {
-        this.billingPeriod = billingPeriod;
+    protected DefaultPlanPhase setPhaseType(final PhaseType cohort) {
+        this.type = cohort;
         return this;
     }
 
@@ -245,10 +198,4 @@ public class DefaultPlanPhase extends ValidatingConfig<StandaloneCatalog> implem
         this.plan = plan;
         return this;
     }
-
-    protected DefaultPlanPhase setBillCycleDuration(final BillingPeriod billingPeriod) {
-        this.billingPeriod = billingPeriod;
-        return this;
-    }
-
 }
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPrice.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPrice.java
index bb3f066..cc5374c 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPrice.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPrice.java
@@ -64,12 +64,12 @@ public class DefaultPrice extends ValidatingConfig<StandaloneCatalog> implements
         return value;
     }
 
-    protected DefaultPrice setCurrency(final Currency currency) {
+    public DefaultPrice setCurrency(final Currency currency) {
         this.currency = currency;
         return this;
     }
 
-    protected DefaultPrice setValue(final BigDecimal value) {
+    public DefaultPrice setValue(final BigDecimal value) {
         this.value = value;
         return this;
     }
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPriceList.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPriceList.java
index cdfdbff..ad4b4ba 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultPriceList.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultPriceList.java
@@ -79,7 +79,7 @@ public class DefaultPriceList extends ValidatingConfig<StandaloneCatalog> implem
     public DefaultPlan findPlan(final Product product, final BillingPeriod period) {
         for (final DefaultPlan cur : getPlans()) {
             if (cur.getProduct().equals(product) &&
-                    (cur.getBillingPeriod() == null || cur.getBillingPeriod().equals(period))) {
+                    (cur.getRecurringBillingPeriod() == null || cur.getRecurringBillingPeriod().equals(period))) {
                 return cur;
             }
         }
@@ -89,11 +89,11 @@ public class DefaultPriceList extends ValidatingConfig<StandaloneCatalog> implem
     @Override
     public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
         for (final DefaultPlan cur : getPlans()) {
-            final int numPlans = findNumberOfPlans(cur.getProduct(), cur.getBillingPeriod());
+            final int numPlans = findNumberOfPlans(cur.getProduct(), cur.getRecurringBillingPeriod());
             if (numPlans > 1) {
                 errors.add(new ValidationError(
                         String.format("There are %d plans in pricelist %s and have the same product/billingPeriod (%s, %s)",
-                                      numPlans, getName(), cur.getProduct().getName(), cur.getBillingPeriod()), catalog.getCatalogURI(),
+                                      numPlans, getName(), cur.getProduct().getName(), cur.getRecurringBillingPeriod()), catalog.getCatalogURI(),
                         DefaultPriceListSet.class, getName()));
             }
         }
@@ -104,7 +104,7 @@ public class DefaultPriceList extends ValidatingConfig<StandaloneCatalog> implem
         int count = 0;
         for (final DefaultPlan cur : getPlans()) {
             if (cur.getProduct().equals(product) &&
-                    (cur.getBillingPeriod() == null || cur.getBillingPeriod().equals(period))) {
+                    (cur.getRecurringBillingPeriod() == null || cur.getRecurringBillingPeriod().equals(period))) {
                 count++;
             }
         }
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultProduct.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultProduct.java
index e1d84fe..fabd692 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultProduct.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultProduct.java
@@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlIDREF;
 import java.net.URI;
 import java.util.Arrays;
 
+import org.killbill.billing.catalog.api.BillingPeriod;
 import org.killbill.billing.catalog.api.Limit;
 import org.killbill.billing.catalog.api.Product;
 import org.killbill.billing.catalog.api.ProductCategory;
@@ -55,7 +56,7 @@ public class DefaultProduct extends ValidatingConfig<StandaloneCatalog> implemen
     @XmlIDREF
     @XmlElement(name = "addonProduct", required = true)
     private DefaultProduct[] available = EMPTY_PRODUCT_LIST;
-    
+
     @XmlElementWrapper(name = "limits", required = false)
     @XmlElement(name = "limit", required = true)
     private DefaultLimit[] limits = new DefaultLimit[0];
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultRecurring.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultRecurring.java
new file mode 100644
index 0000000..874ddd7
--- /dev/null
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultRecurring.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * The Billing Project licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import java.net.URI;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Recurring;
+import org.killbill.billing.util.config.catalog.ValidatingConfig;
+import org.killbill.billing.util.config.catalog.ValidationError;
+import org.killbill.billing.util.config.catalog.ValidationErrors;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class DefaultRecurring extends ValidatingConfig<StandaloneCatalog> implements Recurring {
+
+    @XmlElement(required = true)
+    private BillingPeriod billingPeriod;
+
+    @XmlElement(required = false)
+    private DefaultInternationalPrice recurringPrice;
+
+    // Not exposed in xml.
+    private PlanPhase phase;
+
+    @Override
+    public BillingPeriod getBillingPeriod() {
+        return billingPeriod;
+    }
+
+    @Override
+    public DefaultInternationalPrice getRecurringPrice() {
+        return recurringPrice;
+    }
+
+    @Override
+    public void initialize(final StandaloneCatalog root, final URI uri) {
+        if (recurringPrice != null) {
+            recurringPrice.initialize(root, uri);
+        }
+    }
+
+    @Override
+    public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
+
+        //Validation: check for nulls
+        if (billingPeriod == null) {
+            errors.add(new ValidationError(String.format("Recurring section of Phase %s of plan %s has a recurring price but no billing period", phase.getPhaseType().toString(), phase.getPlan().getName()),
+                                           catalog.getCatalogURI(), DefaultPlanPhase.class, phase.getPhaseType().toString()));
+        }
+
+        //Validation: if there is a recurring price there must be a billing period
+        if ((recurringPrice != null) && (billingPeriod == null || billingPeriod == BillingPeriod.NO_BILLING_PERIOD)) {
+            errors.add(new ValidationError(String.format("Recurring section of Phase %s of plan %s has a recurring price but no billing period", phase.getPhaseType().toString(), phase.getPlan().getName()),
+                                           catalog.getCatalogURI(), DefaultPlanPhase.class, phase.getPhaseType().toString()));
+        }
+
+        //Validation: if there is no recurring price there should be no billing period
+        if ((recurringPrice == null) && billingPeriod != BillingPeriod.NO_BILLING_PERIOD) {
+            errors.add(new ValidationError(String.format("Recurring section of Phase %s of plan %s has no recurring price but does have a billing period. The billing period should be set to '%s'",
+                                                         phase.getPhaseType().toString(), phase.getPlan().getName(), BillingPeriod.NO_BILLING_PERIOD),
+                                           catalog.getCatalogURI(), DefaultPlanPhase.class, phase.getPhaseType().toString()));
+        }
+        return errors;
+    }
+
+    public DefaultRecurring setBillingPeriod(final BillingPeriod billingPeriod) {
+        this.billingPeriod = billingPeriod;
+        return this;
+    }
+
+    public DefaultRecurring setRecurringPrice(final DefaultInternationalPrice recurringPrice) {
+        this.recurringPrice = recurringPrice;
+        return this;
+    }
+
+    public DefaultRecurring setPhase(final PlanPhase phase) {
+        this.phase = phase;
+        return this;
+    }
+}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultTier.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultTier.java
new file mode 100644
index 0000000..2d430cb
--- /dev/null
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultTier.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Block;
+import org.killbill.billing.catalog.api.InternationalPrice;
+import org.killbill.billing.catalog.api.Tier;
+import org.killbill.billing.catalog.api.TieredBlock;
+import org.killbill.billing.catalog.api.UsageType;
+import org.killbill.billing.util.config.catalog.ValidatingConfig;
+import org.killbill.billing.util.config.catalog.ValidationError;
+import org.killbill.billing.util.config.catalog.ValidationErrors;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class DefaultTier extends ValidatingConfig<StandaloneCatalog> implements Tier {
+
+    @XmlElementWrapper(name = "limits", required = false)
+    @XmlElement(name = "limit", required = true)
+    private DefaultLimit[] limits = new DefaultLimit[0];
+
+    @XmlElementWrapper(name = "blocks", required = false)
+    @XmlElement(name = "tieredBlock", required = true)
+    private DefaultTieredBlock[] blocks = new DefaultTieredBlock[0];
+
+    // Used to define a fixed price for the whole tier section
+    @XmlElement(required = false)
+    private DefaultInternationalPrice fixedPrice;
+
+    // Used to define a recurring price for the whole tier section
+    @XmlElement(required = false)
+    private DefaultInternationalPrice recurringPrice;
+
+
+    // Not defined in catalog
+    private DefaultUsage usage;
+
+    @Override
+    public DefaultLimit[] getLimits() {
+        return limits;
+    }
+
+    @Override
+    public DefaultTieredBlock[] getTieredBlocks() {
+        return blocks;
+    }
+
+    @Override
+    public InternationalPrice getFixedPrice() {
+        return fixedPrice;
+    }
+
+    @Override
+    public InternationalPrice getRecurringPrice() {
+        return recurringPrice;
+    }
+
+    public DefaultTier setLimits(final DefaultLimit[] limits) {
+        this.limits = limits;
+        return this;
+    }
+
+    public DefaultTier setBlocks(final DefaultTieredBlock[] blocks) {
+        this.blocks = blocks;
+        return this;
+    }
+
+    public DefaultTier setUsage(final DefaultUsage usage) {
+        this.usage = usage;
+        return this;
+    }
+
+    public DefaultTier setFixedPrice(final DefaultInternationalPrice fixedPrice) {
+        this.fixedPrice = fixedPrice;
+        return this;
+    }
+
+    public DefaultTier setRecurringPrice(final DefaultInternationalPrice recurringPrice) {
+        this.recurringPrice = recurringPrice;
+        return this;
+    }
+
+    @Override
+    public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
+
+        if (usage.getBillingMode() == BillingMode.IN_ARREAR && usage.getUsageType() == UsageType.CAPACITY && limits.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ARREAR CAPACITY] section of phase %s needs to define some limits",
+                                                         usage.getPhase().toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        if (usage.getBillingMode() == BillingMode.IN_ARREAR && usage.getUsageType() == UsageType.CONSUMABLE && blocks.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ARREAR CONSUMABLE] section of phase %s needs to define some blocks",
+                                                         usage.getPhase().toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        validateCollection(catalog, errors, limits);
+        return errors;
+    }
+}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultTieredBlock.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultTieredBlock.java
new file mode 100644
index 0000000..3448c2d
--- /dev/null
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultTieredBlock.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+import org.killbill.billing.catalog.api.BlockType;
+import org.killbill.billing.catalog.api.TieredBlock;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class DefaultTieredBlock extends DefaultBlock implements TieredBlock {
+
+    @XmlElement(required = true)
+    private Double max;
+
+    @Override
+    public Double getMax() {
+        return max;
+    }
+
+    public DefaultTieredBlock setMax(final Double max) {
+        this.max = max;
+        return this;
+    }
+
+    @Override
+    public BlockType getType() {
+        return BlockType.TIERED;
+    }
+
+    @Override
+    public DefaultTieredBlock setType(final BlockType type) {
+        super.setType(BlockType.TIERED);
+        return this;
+    }
+}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultUnit.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultUnit.java
index c383024..4616e05 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/DefaultUnit.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultUnit.java
@@ -45,4 +45,8 @@ public class DefaultUnit extends ValidatingConfig<StandaloneCatalog> implements 
         return errors;
     }
 
+    public DefaultUnit setName(final String name) {
+        this.name = name;
+        return this;
+    }
 }
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/DefaultUsage.java b/catalog/src/main/java/org/killbill/billing/catalog/DefaultUsage.java
new file mode 100644
index 0000000..9b7c328
--- /dev/null
+++ b/catalog/src/main/java/org/killbill/billing/catalog/DefaultUsage.java
@@ -0,0 +1,238 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import java.net.URI;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlID;
+
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.Block;
+import org.killbill.billing.catalog.api.InternationalPrice;
+import org.killbill.billing.catalog.api.Limit;
+import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Tier;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.catalog.api.UsageType;
+import org.killbill.billing.util.config.catalog.ValidatingConfig;
+import org.killbill.billing.util.config.catalog.ValidationError;
+import org.killbill.billing.util.config.catalog.ValidationErrors;
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class DefaultUsage extends ValidatingConfig<StandaloneCatalog> implements Usage {
+
+    @XmlAttribute(required = true)
+    @XmlID
+    private String name;
+
+    @XmlAttribute(required = true)
+    private BillingMode billingMode;
+
+    @XmlAttribute(required = true)
+    private UsageType usageType;
+
+    @XmlElement(required = true)
+    private BillingPeriod billingPeriod;
+
+    // Used for when billing usage IN_ADVANCE & CAPACITY
+    @XmlElementWrapper(name = "limits", required = false)
+    @XmlElement(name = "limit", required = true)
+    private DefaultLimit[] limits = new DefaultLimit[0];
+
+    // Used for when billing usage IN_ADVANCE & CONSUMABLE
+    @XmlElementWrapper(name = "blocks", required = false)
+    @XmlElement(name = "block", required = true)
+    private DefaultBlock[] blocks = new DefaultBlock[0];
+
+    // Used for when billing usage IN_ARREAR
+    @XmlElementWrapper(name = "tiers", required = false)
+    @XmlElement(name = "tier", required = true)
+    private DefaultTier[] tiers = new DefaultTier[0];
+
+    // Used to define a fixed price for the whole usage section -- bundle several limits/blocks of units.
+    @XmlElement(required = false)
+    private DefaultInternationalPrice fixedPrice;
+
+    // Used to define a recurring price for the whole usage section -- bundle several limits/blocks of units.
+    @XmlElement(required = false)
+    private DefaultInternationalPrice recurringPrice;
+
+
+    // Not exposed in xml.
+    private PlanPhase phase;
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public BillingMode getBillingMode() {
+        return billingMode;
+    }
+
+    @Override
+    public UsageType getUsageType() {
+        return usageType;
+    }
+
+    @Override
+    public BillingPeriod getBillingPeriod() {
+        return billingPeriod;
+    }
+
+    @Override
+    public boolean compliesWithLimits(final String unit, final double value) {
+        final Limit limit = findLimit(unit);
+        if (limit != null && !limit.compliesWith(value)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public Limit[] getLimits() {
+        return limits;
+    }
+
+    @Override
+    public Tier[] getTiers() {
+        return tiers;
+    }
+
+    @Override
+    public Block[] getBlocks() {
+        return blocks;
+    }
+
+    @Override
+    public InternationalPrice getFixedPrice() {
+        return fixedPrice;
+    }
+
+    @Override
+    public InternationalPrice getRecurringPrice() {
+        return recurringPrice;
+    }
+
+    @Override
+    public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
+        if (billingMode == BillingMode.IN_ADVANCE && usageType == UsageType.CAPACITY && limits.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ADVANCE CAPACITY] section of phase %s needs to define some limits",
+                                                         phase.toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        if (billingMode == BillingMode.IN_ADVANCE && usageType == UsageType.CONSUMABLE && blocks.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ADVANCE CONSUMABLE] section of phase %s needs to define some blocks",
+                                                         phase.toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+
+        if (billingMode == BillingMode.IN_ARREAR && tiers.length == 0) {
+            errors.add(new ValidationError(String.format("Usage [IN_ARREAR] section of phase %s needs to define some tiers",
+                                                         phase.toString()), catalog.getCatalogURI(), DefaultUsage.class, ""));
+        }
+        validateCollection(catalog, errors, limits);
+        validateCollection(catalog, errors, tiers);
+        return errors;
+    }
+
+    @Override
+    public void initialize(final StandaloneCatalog root, final URI uri) {
+        for (DefaultLimit limit : limits) {
+            limit.initialize(root, uri);
+            limit.setUsage(this);
+        }
+        for (DefaultBlock block : blocks) {
+            block.initialize(root, uri);
+            block.setUsage(this);
+        }
+
+        for (DefaultTier tier : tiers) {
+            tier.initialize(root, uri);
+            tier.setUsage(this);
+        }
+    }
+
+    public PlanPhase getPhase() {
+        return phase;
+    }
+
+    public DefaultUsage setBillingPeriod(final BillingPeriod billingPeriod) {
+        this.billingPeriod = billingPeriod;
+        return this;
+    }
+
+    public DefaultUsage setName(final String name) {
+        this.name = name;
+        return this;
+    }
+
+    public DefaultUsage setBillingMode(final BillingMode billingMode) {
+        this.billingMode = billingMode;
+        return this;
+    }
+
+    public DefaultUsage setUsageType(final UsageType usageType) {
+        this.usageType = usageType;
+        return this;
+    }
+
+    public DefaultUsage setPhase(final PlanPhase phase) {
+        this.phase = phase;
+        return this;
+    }
+
+    public DefaultUsage setTiers(final DefaultTier[] tiers) {
+        this.tiers = tiers;
+        return this;
+    }
+
+
+    public DefaultUsage setBlocks(final DefaultBlock[] blocks) {
+        this.blocks = blocks;
+        return this;
+    }
+
+    public DefaultUsage setLimits(final DefaultLimit[] limits) {
+        this.limits = limits;
+        return this;
+    }
+
+    public DefaultUsage setFixedPrice(final DefaultInternationalPrice fixedPrice) {
+        this.fixedPrice = fixedPrice;
+        return this;
+    }
+
+    public DefaultUsage setRecurringPrice(final DefaultInternationalPrice recurringPrice) {
+        this.recurringPrice = recurringPrice;
+        return this;
+    }
+
+    protected Limit findLimit(String unit) {
+        for (Limit limit : limits) {
+            if (limit.getUnit().getName().equals(unit)) {
+                return limit;
+            }
+        }
+        return null;
+    }
+}
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/StandaloneCatalog.java b/catalog/src/main/java/org/killbill/billing/catalog/StandaloneCatalog.java
index 3b611fa..42297ee 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/StandaloneCatalog.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/StandaloneCatalog.java
@@ -18,7 +18,6 @@ package org.killbill.billing.catalog;
 
 import java.net.URI;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 
@@ -31,10 +30,10 @@ import javax.xml.bind.annotation.XmlRootElement;
 import org.killbill.billing.ErrorCode;
 import org.killbill.billing.catalog.api.BillingActionPolicy;
 import org.killbill.billing.catalog.api.BillingAlignment;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.killbill.billing.catalog.api.BillingPeriod;
 import org.killbill.billing.catalog.api.CatalogApiException;
 import org.killbill.billing.catalog.api.Currency;
-import org.killbill.billing.catalog.api.Limit;
 import org.killbill.billing.catalog.api.Listing;
 import org.killbill.billing.catalog.api.Plan;
 import org.killbill.billing.catalog.api.PlanAlignmentChange;
@@ -49,7 +48,6 @@ import org.killbill.billing.catalog.api.ProductCategory;
 import org.killbill.billing.catalog.api.StaticCatalog;
 import org.killbill.billing.catalog.rules.PlanRules;
 import org.killbill.billing.util.config.catalog.ValidatingConfig;
-import org.killbill.billing.util.config.catalog.ValidationError;
 import org.killbill.billing.util.config.catalog.ValidationErrors;
 
 @XmlRootElement(name = "catalog")
@@ -61,6 +59,9 @@ public class StandaloneCatalog extends ValidatingConfig<StandaloneCatalog> imple
     @XmlElement(required = true)
     private String catalogName;
 
+    @XmlElement(required = true)
+    private BillingMode recurringBillingMode;
+
     private URI catalogURI;
 
     @XmlElementWrapper(name = "currencies", required = true)
@@ -105,6 +106,11 @@ public class StandaloneCatalog extends ValidatingConfig<StandaloneCatalog> imple
         return effectiveDate;
     }
 
+    @Override
+    public BillingMode getRecurringBillingMode() {
+        return recurringBillingMode;
+    }
+
     /* (non-Javadoc)
      * @see org.killbill.billing.catalog.ICatalog#getProducts()
      */
@@ -253,21 +259,13 @@ public class StandaloneCatalog extends ValidatingConfig<StandaloneCatalog> imple
 
     @Override
     public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) {
-        validate(catalog, errors, products);
-        validate(catalog, errors, plans);
+        validateCollection(catalog, errors, products);
+        validateCollection(catalog, errors, plans);
         priceLists.validate(catalog, errors);
         planRules.validate(catalog, errors);
         return errors;
     }
 
-    private Collection<? extends ValidationError> validate(final StandaloneCatalog catalog,
-                                                           final ValidationErrors errors, final ValidatingConfig<StandaloneCatalog>[] configs) {
-        for (final ValidatingConfig<StandaloneCatalog> config : configs) {
-            config.validate(catalog, errors);
-        }
-        return errors;
-    }
-
 
     @Override
     public void initialize(final StandaloneCatalog catalog, final URI sourceURI) {
@@ -317,11 +315,21 @@ public class StandaloneCatalog extends ValidatingConfig<StandaloneCatalog> imple
         return this;
     }
 
+    public StandaloneCatalog setCatalogName(final String catalogName) {
+        this.catalogName = catalogName;
+        return this;
+    }
+
     protected StandaloneCatalog setEffectiveDate(final Date effectiveDate) {
         this.effectiveDate = effectiveDate;
         return this;
     }
 
+    public StandaloneCatalog setRecurringBillingMode(final BillingMode recurringBillingMode) {
+        this.recurringBillingMode = recurringBillingMode;
+        return this;
+    }
+
     protected StandaloneCatalog setPlanRules(final PlanRules planRules) {
         this.planRules = planRules;
         return this;
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/VersionedCatalog.java b/catalog/src/main/java/org/killbill/billing/catalog/VersionedCatalog.java
index 754b3f7..81affbf 100644
--- a/catalog/src/main/java/org/killbill/billing/catalog/VersionedCatalog.java
+++ b/catalog/src/main/java/org/killbill/billing/catalog/VersionedCatalog.java
@@ -33,6 +33,7 @@ import org.joda.time.DateTime;
 import org.killbill.billing.ErrorCode;
 import org.killbill.billing.catalog.api.BillingActionPolicy;
 import org.killbill.billing.catalog.api.BillingAlignment;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.killbill.billing.catalog.api.BillingPeriod;
 import org.killbill.billing.catalog.api.Catalog;
 import org.killbill.billing.catalog.api.CatalogApiException;
@@ -60,6 +61,7 @@ public class VersionedCatalog extends ValidatingConfig<StandaloneCatalog> implem
 
     private final Clock clock;
     private String catalogName;
+    private BillingMode recurringBillingMode;
 
     @XmlElement(name = "catalogVersion", required = true)
     private final List<StandaloneCatalog> versions = new ArrayList<StandaloneCatalog>();
@@ -168,10 +170,17 @@ public class VersionedCatalog extends ValidatingConfig<StandaloneCatalog> implem
         if (catalogName == null) {
             catalogName = e.getCatalogName();
         } else {
-            if (!catalogName.equals(getCatalogName())) {
+            if (!catalogName.equals(e.getCatalogName())) {
                 throw new CatalogApiException(ErrorCode.CAT_CATALOG_NAME_MISMATCH, catalogName, e.getCatalogName());
             }
         }
+        if (recurringBillingMode == null) {
+            recurringBillingMode = e.getRecurringBillingMode();
+        } else {
+            if (!recurringBillingMode.equals(e.getRecurringBillingMode())) {
+                throw new CatalogApiException(ErrorCode.CAT_CATALOG_RECURRING_MODE_MISMATCH, recurringBillingMode, e.getRecurringBillingMode());
+            }
+        }
         versions.add(e);
         Collections.sort(versions, new Comparator<StandaloneCatalog>() {
             @Override
@@ -358,6 +367,11 @@ public class VersionedCatalog extends ValidatingConfig<StandaloneCatalog> implem
     }
 
     @Override
+    public BillingMode getRecurringBillingMode() {
+        return recurringBillingMode;
+    }
+
+    @Override
     public Currency[] getCurrentSupportedCurrencies() throws CatalogApiException {
         return versionForDate(clock.getUTCNow()).getCurrentSupportedCurrencies();
     }
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/io/TestXMLReader.java b/catalog/src/test/java/org/killbill/billing/catalog/io/TestXMLReader.java
index 0b906af..f05c686 100644
--- a/catalog/src/test/java/org/killbill/billing/catalog/io/TestXMLReader.java
+++ b/catalog/src/test/java/org/killbill/billing/catalog/io/TestXMLReader.java
@@ -16,23 +16,241 @@
 
 package org.killbill.billing.catalog.io;
 
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import java.math.BigDecimal;
 
-import com.google.common.io.Resources;
 import org.killbill.billing.catalog.CatalogTestSuiteNoDB;
+import org.killbill.billing.catalog.DefaultTieredBlock;
 import org.killbill.billing.catalog.StandaloneCatalog;
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.CatalogApiException;
+import org.killbill.billing.catalog.api.Currency;
+import org.killbill.billing.catalog.api.Plan;
+import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.catalog.api.UsageType;
 import org.killbill.billing.util.config.catalog.XMLLoader;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import com.google.common.io.Resources;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
 
 public class TestXMLReader extends CatalogTestSuiteNoDB {
+
     @Test(groups = "fast")
     public void testCatalogLoad() {
         try {
+            XMLLoader.getObjectFromString(Resources.getResource("SpyCarBasic.xml").toExternalForm(), StandaloneCatalog.class);
+            XMLLoader.getObjectFromString(Resources.getResource("SpyCarAdvanced.xml").toExternalForm(), StandaloneCatalog.class);
             XMLLoader.getObjectFromString(Resources.getResource("WeaponsHire.xml").toExternalForm(), StandaloneCatalog.class);
             XMLLoader.getObjectFromString(Resources.getResource("WeaponsHireSmall.xml").toExternalForm(), StandaloneCatalog.class);
-            XMLLoader.getObjectFromString(Resources.getResource("SpyCarBasic.xml").toExternalForm(), StandaloneCatalog.class);
+
+            XMLLoader.getObjectFromString(Resources.getResource("catalogTest.xml").toExternalForm(), StandaloneCatalog.class);
+
+            XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+
+    @Test(groups = "fast")
+    public void testUsageCapacityInAdvance() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "capacity-in-advance-monthly");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getName(), "capacity-in-advance-monthly-usage1");
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.MONTHLY);
+            assertEquals(usage.getUsageType(), UsageType.CAPACITY);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ADVANCE);
+
+            assertEquals(usage.getBlocks().length, 0);
+            assertEquals(usage.getTiers().length, 0);
+
+            assertEquals(usage.getLimits().length, 1);
+            assertEquals(usage.getLimits()[0].getUnit().getName(), "members");
+            assertEquals(usage.getLimits()[0].getMax(), new Double("100"));
+
+            assertEquals(usage.getRecurringPrice().getPrices().length, 1);
+            assertEquals(usage.getRecurringPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getRecurringPrice().getPrices()[0].getValue(), new BigDecimal("100.00"));
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+    @Test(groups = "fast")
+    public void testUsageConsumableInAdvancePrepayCredit() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "consumable-in-advance-prepay-credit-monthly");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getName(), "consumable-in-advance-prepay-credit-monthly-usage1");
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.MONTHLY);
+            assertEquals(usage.getUsageType(), UsageType.CONSUMABLE);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ADVANCE);
+
+            assertEquals(usage.getLimits().length, 0);
+            assertEquals(usage.getTiers().length, 0);
+
+            assertEquals(usage.getBlocks().length, 1);
+
+            assertEquals(usage.getBlocks()[0].getUnit().getName(), "cell-phone-minutes");
+            assertEquals(usage.getBlocks()[0].getSize(), new Double("1000"));
+
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices().length, 1);
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices()[0].getValue(), new BigDecimal("0.10"));
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+
+    @Test(groups = "fast")
+    public void testUsageConsumableInAdvanceTopUp() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "consumable-in-advance-topup");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getName(), "consumable-in-advance-topup-usage1");
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.NO_BILLING_PERIOD);
+            assertEquals(usage.getUsageType(), UsageType.CONSUMABLE);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ADVANCE);
+
+            assertEquals(usage.getLimits().length, 0);
+            assertEquals(usage.getTiers().length, 0);
+
+            assertEquals(usage.getBlocks().length, 1);
+
+            assertEquals(usage.getBlocks()[0].getUnit().getName(), "fastrack-tokens");
+            assertEquals(usage.getBlocks()[0].getSize(), new Double("10"));
+
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices().length, 1);
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getBlocks()[0].getPrice().getPrices()[0].getValue(), new BigDecimal("0.10"));
+
+            assertEquals(usage.getBlocks()[0].getMinTopUpCredit(), new Double("5"));
+
         } catch (Exception e) {
             Assert.fail(e.toString());
         }
     }
+
+
+    @Test(groups = "fast")
+    public void testUsageCapacityInArrear() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "capacity-in-arrear");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getName(), "capacity-in-arrear-usage1");
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.MONTHLY);
+            assertEquals(usage.getUsageType(), UsageType.CAPACITY);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ARREAR);
+
+            assertEquals(usage.getLimits().length, 0);
+            assertEquals(usage.getBlocks().length, 0);
+
+            assertEquals(usage.getTiers().length, 2);
+
+
+            assertEquals(usage.getTiers()[0].getLimits().length, 2);
+            assertEquals(usage.getTiers()[0].getLimits()[0].getUnit().getName(), "bandwith-meg-sec");
+            assertEquals(usage.getTiers()[0].getLimits()[0].getMax(), new Double("100"));
+            assertEquals(usage.getTiers()[0].getLimits()[1].getUnit().getName(), "members");
+            assertEquals(usage.getTiers()[0].getLimits()[1].getMax(), new Double("500"));
+            assertEquals(usage.getTiers()[0].getFixedPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[0].getFixedPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[0].getFixedPrice().getPrices()[0].getValue(), new BigDecimal("0.007"));
+            assertEquals(usage.getTiers()[0].getRecurringPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[0].getRecurringPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[0].getRecurringPrice().getPrices()[0].getValue(), new BigDecimal("0.8"));
+
+            assertEquals(usage.getTiers()[1].getLimits()[0].getUnit().getName(), "bandwith-meg-sec");
+            assertEquals(usage.getTiers()[1].getLimits()[0].getMax(), new Double("100"));
+            assertEquals(usage.getTiers()[1].getLimits()[1].getUnit().getName(), "members");
+            assertEquals(usage.getTiers()[1].getLimits()[1].getMax(), new Double("1000"));
+            assertEquals(usage.getTiers()[1].getFixedPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[1].getFixedPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[1].getFixedPrice().getPrices()[0].getValue(), new BigDecimal("0.4"));
+            assertEquals(usage.getTiers()[1].getRecurringPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[1].getRecurringPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[1].getRecurringPrice().getPrices()[0].getValue(), new BigDecimal("1.2"));
+
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+
+    @Test(groups = "fast")
+    public void testUsageConsumableInArrear() {
+
+        try {
+            final StandaloneCatalog catalog = XMLLoader.getObjectFromString(Resources.getResource("UsageExperimental.xml").toExternalForm(), StandaloneCatalog.class);
+
+            final Usage[] usages = getUsages(catalog, "consumable-in-arrear");
+            assertEquals(usages.length, 1);
+            final Usage usage = usages[0];
+
+            assertEquals(usage.getName(), "consumable-in-arrear-usage1");
+            assertEquals(usage.getBillingPeriod(), BillingPeriod.MONTHLY);
+            assertEquals(usage.getUsageType(), UsageType.CONSUMABLE);
+            assertEquals(usage.getBillingMode(), BillingMode.IN_ARREAR);
+
+            assertEquals(usage.getLimits().length, 0);
+            assertEquals(usage.getBlocks().length, 0);
+
+            assertEquals(usage.getTiers().length, 1);
+
+            assertEquals(usage.getTiers()[0].getTieredBlocks().length, 2);
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[0].getUnit().getName(), "cell-phone-minutes");
+
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[0].getSize(), new Double("1000"));
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[0].getMax(), new Double("10000"));
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[0].getPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[0].getPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[0].getPrice().getPrices()[0].getValue(), new BigDecimal("0.5"));
+
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[1].getUnit().getName(), "Mbytes");
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[1].getSize(), new Double("512"));
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[1].getMax(), new Double("512000"));
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[1].getPrice().getPrices().length, 1);
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[1].getPrice().getPrices()[0].getCurrency(), Currency.BTC);
+            assertEquals(usage.getTiers()[0].getTieredBlocks()[1].getPrice().getPrices()[0].getValue(), new BigDecimal("0.3"));
+        } catch (Exception e) {
+            Assert.fail(e.toString());
+        }
+    }
+
+
+    private Usage[] getUsages(final StandaloneCatalog catalog, final String planName) throws CatalogApiException {
+        final Plan plan  = catalog.findCurrentPlan(planName);
+        assertNotNull(plan);
+        final PlanPhase phase = plan.getFinalPhase();
+        assertNotNull(phase);
+        final Usage[] usages = phase.getUsages();
+        return usages;
+    }
 }
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/MockPlanPhase.java b/catalog/src/test/java/org/killbill/billing/catalog/MockPlanPhase.java
index ab9aab6..5ba79d3 100644
--- a/catalog/src/test/java/org/killbill/billing/catalog/MockPlanPhase.java
+++ b/catalog/src/test/java/org/killbill/billing/catalog/MockPlanPhase.java
@@ -68,11 +68,10 @@ public class MockPlanPhase extends DefaultPlanPhase {
             final DefaultDuration duration,
             final DefaultInternationalPrice recurringPrice,
             final DefaultInternationalPrice fixedPrice) {
-        setBillingPeriod(billingPeriod);
         setPhaseType(type);
         setDuration(duration);
-        setRecurringPrice(recurringPrice);
-        setFixedPrice(fixedPrice);
+        setFixed(new MockFixed(fixedPrice));
+        setRecurring(new MockRecurring(billingPeriod, recurringPrice).setPhase(this));
     }
 
     public MockPlanPhase() {
@@ -94,29 +93,26 @@ public class MockPlanPhase extends DefaultPlanPhase {
                          @Nullable final MockInternationalPrice fixedPrice,
                          final BillingPeriod billingPeriod,
                          final PhaseType phaseType) {
-        setBillingPeriod(billingPeriod);
         setPhaseType(phaseType);
         setDuration(new DefaultDuration().setNumber(-1).setUnit(TimeUnit.UNLIMITED));
-        setRecurringPrice(recurringPrice);
-        setFixedPrice(fixedPrice);
         setPlan(new MockPlan(this));
+        setFixed(new MockFixed(fixedPrice));
+        setRecurring(new MockRecurring(billingPeriod, recurringPrice));
     }
 
     public MockPlanPhase(final MockPlan mockPlan) {
-        setBillingPeriod(BillingPeriod.MONTHLY);
         setPhaseType(PhaseType.EVERGREEN);
         setDuration(new DefaultDuration().setNumber(-1).setUnit(TimeUnit.UNLIMITED));
-        setRecurringPrice(new MockInternationalPrice());
-        setFixedPrice(null);
         setPlan(mockPlan);
+        setFixed(new MockFixed(null));
+        setRecurring(new MockRecurring(BillingPeriod.MONTHLY, new MockInternationalPrice()));
     }
 
     public MockPlanPhase(final Plan plan, final PhaseType phaseType) {
-        setBillingPeriod(BillingPeriod.MONTHLY);
         setPhaseType(phaseType);
         setDuration(new DefaultDuration().setNumber(-1).setUnit(TimeUnit.UNLIMITED));
-        setRecurringPrice(new MockInternationalPrice());
-        setFixedPrice(null);
         setPlan(plan);
+        setFixed(new MockFixed(null));
+        setRecurring(new MockRecurring(BillingPeriod.MONTHLY, new MockInternationalPrice()));
     }
 }
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/MockRecurring.java b/catalog/src/test/java/org/killbill/billing/catalog/MockRecurring.java
new file mode 100644
index 0000000..ac95f85
--- /dev/null
+++ b/catalog/src/test/java/org/killbill/billing/catalog/MockRecurring.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * The Billing Project licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.catalog;
+
+import org.killbill.billing.catalog.api.BillingPeriod;
+
+public class MockRecurring extends DefaultRecurring {
+
+    public MockRecurring(final BillingPeriod billingPeriod,
+                         final DefaultInternationalPrice recurringPrice) {
+        setBillingPeriod(billingPeriod);
+        setRecurringPrice(recurringPrice);
+    }
+
+}
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/TestInternationalPrice.java b/catalog/src/test/java/org/killbill/billing/catalog/TestInternationalPrice.java
index dd62253..9fb17df 100644
--- a/catalog/src/test/java/org/killbill/billing/catalog/TestInternationalPrice.java
+++ b/catalog/src/test/java/org/killbill/billing/catalog/TestInternationalPrice.java
@@ -63,9 +63,9 @@ public class TestInternationalPrice extends CatalogTestSuiteNoDB {
     public void testPriceInitialization() throws URISyntaxException, CatalogApiException {
         final StandaloneCatalog c = new MockCatalog();
         c.setSupportedCurrencies(new Currency[]{Currency.GBP, Currency.EUR, Currency.USD, Currency.BRL, Currency.MXN});
-        c.getCurrentPlans()[0].getFinalPhase().getRecurringPrice().setPrices(null);
+        ((DefaultInternationalPrice) c.getCurrentPlans()[0].getFinalPhase().getRecurring().getRecurringPrice()).setPrices(null);
         c.initialize(c, new URI("foo://bar"));
-        Assert.assertEquals(c.getCurrentPlans()[0].getFinalPhase().getRecurringPrice().getPrice(Currency.GBP), new BigDecimal(0));
+        Assert.assertEquals(c.getCurrentPlans()[0].getFinalPhase().getRecurring().getRecurringPrice().getPrice(Currency.GBP), new BigDecimal(0));
     }
 
     @Test(groups = "fast")
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/TestLimits.java b/catalog/src/test/java/org/killbill/billing/catalog/TestLimits.java
index 5e7246b..7cfe30c 100644
--- a/catalog/src/test/java/org/killbill/billing/catalog/TestLimits.java
+++ b/catalog/src/test/java/org/killbill/billing/catalog/TestLimits.java
@@ -16,17 +16,17 @@
 
 package org.killbill.billing.catalog;
 
+import org.killbill.billing.catalog.api.PlanPhase;
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 import com.google.common.io.Resources;
-import org.killbill.billing.catalog.api.PlanPhase;
-import org.killbill.billing.lifecycle.KillbillService.ServiceException;
 
 public class TestLimits extends CatalogTestSuiteNoDB {
+
     private VersionedCatalog catalog;
-    
+
     @BeforeClass(groups = "fast")
     public void beforeClass() throws Exception {
         super.beforeClass();
@@ -37,17 +37,26 @@ public class TestLimits extends CatalogTestSuiteNoDB {
     public void testLimits() throws Exception {
         PlanPhase phase = catalog.findCurrentPhase("pistol-monthly-evergreen");
         Assert.assertNotNull(phase);
-        
-        //<limits>
-        //    <limit>
-        //        <unit>targets</unit>
-        //        <min>3</min>
-        //    </limit>
-        //    <limit>
-        //        <unit>misfires</unit>
-        //        <max>20</max>
-        //    </limit>
-        //</limits>
+
+
+        /*
+                     <usages>
+                    <usage>
+                        <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
+                        <limits>
+                            <limit>
+                                <unit>targets</unit>
+                                <min>3</min>
+                            </limit>
+                            <limit>
+                                <unit>misfires</unit>
+                                <max>20</max>
+                            </limit>
+                        </limits>
+                    </usage>
+                </usages>
+         */
+
         Assert.assertTrue(catalog.compliesWithLimits("pistol-monthly-evergreen", "targets", 3));
         Assert.assertTrue(catalog.compliesWithLimits("pistol-monthly-evergreen", "targets", 2000));
         Assert.assertFalse(catalog.compliesWithLimits("pistol-monthly-evergreen", "targets", 2));
@@ -55,38 +64,40 @@ public class TestLimits extends CatalogTestSuiteNoDB {
         Assert.assertTrue(catalog.compliesWithLimits("pistol-monthly-evergreen", "misfires", 3));
         Assert.assertFalse(catalog.compliesWithLimits("pistol-monthly-evergreen", "misfires", 21));
         Assert.assertTrue(catalog.compliesWithLimits("pistol-monthly-evergreen", "misfires", -1));
-/*      <product name="Shotgun">
-            <category>BASE</category>
-            <limits>
+
+
+        /*
+            <product name="Shotgun">
+              <category>BASE</category>
+              <limits>
                 <limit>
                     <unit>shells</unit>
                     <max>300</max>
                 </limit>
-            </limits>
-        </product>
-        <plan name="shotgun-annual">
-            <product>Shotgun</product>
-        ...
-            <finalPhase type="EVERGREEN">
-                <limits>
-                    <limit>
-                        <unit>shells</unit>
-                        <max>200</max>
-                    </limit>
-                </limits>
-            </finalPhase>
-        </plan>
-*/
+              </limits>
+            </product>
+        */
         Assert.assertTrue(catalog.compliesWithLimits("shotgun-monthly-evergreen", "shells", 100));
         Assert.assertFalse(catalog.compliesWithLimits("shotgun-monthly-evergreen", "shells", 400));
         Assert.assertTrue(catalog.compliesWithLimits("shotgun-monthly-evergreen", "shells", 250));
-     
+
+       /*
+                   <!-- shotgun-annual-evergreen -->
+                   <usages>
+                    <usage>
+                        <billingPeriod>ANNUAL</billingPeriod>
+                        <limits>
+                            <limit>
+                                <unit>shells</unit>
+                                <max>200</max>
+                            </limit>
+                        </limits>
+                    </usage>
+                </usages>
+         */
         Assert.assertTrue(catalog.compliesWithLimits("shotgun-annual-evergreen", "shells", 100));
         Assert.assertFalse(catalog.compliesWithLimits("shotgun-annual-evergreen", "shells", 400));
         Assert.assertFalse(catalog.compliesWithLimits("shotgun-annual-evergreen", "shells", 250));
-     
-        
-        
-        
+
     }
 }
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/TestPlanPhase.java b/catalog/src/test/java/org/killbill/billing/catalog/TestPlanPhase.java
index 7fcf043..e68244d 100644
--- a/catalog/src/test/java/org/killbill/billing/catalog/TestPlanPhase.java
+++ b/catalog/src/test/java/org/killbill/billing/catalog/TestPlanPhase.java
@@ -16,6 +16,8 @@
 
 package org.killbill.billing.catalog;
 
+import java.math.BigDecimal;
+
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -28,21 +30,16 @@ public class TestPlanPhase extends CatalogTestSuiteNoDB {
 
     @Test(groups = "fast")
     public void testValidation() {
-        DefaultPlanPhase pp = MockPlanPhase.createUSDMonthlyEvergreen(null, "1.00").setPlan(MockPlan.createBicycleNoTrialEvergreen1USD());//new MockPlanPhase().setBillCycleDuration(BillingPeriod.MONTHLY).setRecurringPrice(null).setFixedPrice(new DefaultInternationalPrice());
+        DefaultPlanPhase pp = MockPlanPhase.createUSDMonthlyEvergreen(null, "1.00").setPlan(MockPlan.createBicycleNoTrialEvergreen1USD());
 
         ValidationErrors errors = pp.validate(new MockCatalog(), new ValidationErrors());
         errors.log(log);
         Assert.assertEquals(errors.size(), 1);
 
-        pp = MockPlanPhase.createUSDMonthlyEvergreen("1.00", null).setBillCycleDuration(BillingPeriod.NO_BILLING_PERIOD).setPlan(MockPlan.createBicycleNoTrialEvergreen1USD());// new MockPlanPhase().setBillCycleDuration(BillingPeriod.NO_BILLING_PERIOD).setRecurringPrice(new MockInternationalPrice());
+        pp = MockPlanPhase.createUSDMonthlyEvergreen("1.00", null).setRecurring(new MockRecurring(BillingPeriod.NO_BILLING_PERIOD, MockInternationalPrice.createUSD("1.00")).setPhase(pp)).setPlan(MockPlan.createBicycleNoTrialEvergreen1USD());
         errors = pp.validate(new MockCatalog(), new ValidationErrors());
         errors.log(log);
-        Assert.assertEquals(errors.size(), 2);
-
-        pp = MockPlanPhase.createUSDMonthlyEvergreen(null, null).setBillCycleDuration(BillingPeriod.NO_BILLING_PERIOD).setPlan(MockPlan.createBicycleNoTrialEvergreen1USD());//new MockPlanPhase().setRecurringPrice(null).setFixedPrice(null).setBillCycleDuration(BillingPeriod.NO_BILLING_PERIOD);
-        errors = pp.validate(new MockCatalog(), new ValidationErrors());
-        errors.log(log);
-        Assert.assertEquals(errors.size(), 2);
+        Assert.assertEquals(errors.size(), 1);
     }
 
     @Test(groups = "fast")
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/TestPriceListSet.java b/catalog/src/test/java/org/killbill/billing/catalog/TestPriceListSet.java
index c215fd7..d38438a 100644
--- a/catalog/src/test/java/org/killbill/billing/catalog/TestPriceListSet.java
+++ b/catalog/src/test/java/org/killbill/billing/catalog/TestPriceListSet.java
@@ -37,14 +37,14 @@ public class TestPriceListSet extends CatalogTestSuiteNoDB {
         final DefaultProduct foo = new DefaultProduct("Foo", ProductCategory.BASE);
         final DefaultProduct bar = new DefaultProduct("Bar", ProductCategory.BASE);
         final DefaultPlan[] defaultPlans = new DefaultPlan[]{
-                new MockPlan().setName("plan-foo-monthly").setProduct(foo).setFinalPhase(new MockPlanPhase().setBillCycleDuration(MONTHLY).setPhaseType(EVERGREEN)),
-                new MockPlan().setName("plan-bar-monthly").setProduct(bar).setFinalPhase(new MockPlanPhase().setBillCycleDuration(MONTHLY).setPhaseType(EVERGREEN)),
-                new MockPlan().setName("plan-foo-annual").setProduct(foo).setFinalPhase(new MockPlanPhase().setBillCycleDuration(ANNUAL).setPhaseType(EVERGREEN)),
-                new MockPlan().setName("plan-bar-annual").setProduct(bar).setFinalPhase(new MockPlanPhase().setBillCycleDuration(ANNUAL).setPhaseType(EVERGREEN))
+                new MockPlan().setName("plan-foo-monthly").setProduct(foo).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(MONTHLY, null)).setPhaseType(EVERGREEN)),
+                new MockPlan().setName("plan-bar-monthly").setProduct(bar).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(MONTHLY, null)).setPhaseType(EVERGREEN)),
+                new MockPlan().setName("plan-foo-annual").setProduct(foo).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(ANNUAL, null)).setPhaseType(EVERGREEN)),
+                new MockPlan().setName("plan-bar-annual").setProduct(bar).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(ANNUAL, null)).setPhaseType(EVERGREEN))
         };
         final DefaultPlan[] childPlans = new DefaultPlan[]{
-                new MockPlan().setName("plan-foo").setProduct(foo).setFinalPhase(new MockPlanPhase().setBillCycleDuration(ANNUAL).setPhaseType(DISCOUNT)),
-                new MockPlan().setName("plan-bar").setProduct(bar).setFinalPhase(new MockPlanPhase().setBillCycleDuration(ANNUAL).setPhaseType(DISCOUNT))
+                new MockPlan().setName("plan-foo").setProduct(foo).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(ANNUAL, null)).setPhaseType(DISCOUNT)),
+                new MockPlan().setName("plan-bar").setProduct(bar).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(ANNUAL, null)).setPhaseType(DISCOUNT))
         };
         final PriceListDefault defaultPriceList = new PriceListDefault(defaultPlans);
         final DefaultPriceList[] childPriceLists = new DefaultPriceList[]{
@@ -63,14 +63,14 @@ public class TestPriceListSet extends CatalogTestSuiteNoDB {
         final DefaultProduct foo = new DefaultProduct("Foo", ProductCategory.BASE);
         final DefaultProduct bar = new DefaultProduct("Bar", ProductCategory.BASE);
         final DefaultPlan[] defaultPlans = new DefaultPlan[]{
-                new MockPlan().setName("plan-foo-monthly").setProduct(foo).setFinalPhase(new MockPlanPhase().setBillCycleDuration(MONTHLY).setPhaseType(EVERGREEN)),
-                new MockPlan().setName("plan-bar-monthly").setProduct(bar).setFinalPhase(new MockPlanPhase().setBillCycleDuration(MONTHLY).setPhaseType(EVERGREEN)),
-                new MockPlan().setName("plan-foo-annual").setProduct(foo).setFinalPhase(new MockPlanPhase().setBillCycleDuration(null).setPhaseType(EVERGREEN)),
-                new MockPlan().setName("plan-bar-annual").setProduct(bar).setFinalPhase(new MockPlanPhase().setBillCycleDuration(null).setPhaseType(EVERGREEN))
+                new MockPlan().setName("plan-foo-monthly").setProduct(foo).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(MONTHLY, null)).setPhaseType(EVERGREEN)),
+                new MockPlan().setName("plan-bar-monthly").setProduct(bar).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(MONTHLY, null)).setPhaseType(EVERGREEN)),
+                new MockPlan().setName("plan-foo-annual").setProduct(foo).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(null, null)).setPhaseType(EVERGREEN)),
+                new MockPlan().setName("plan-bar-annual").setProduct(bar).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(null, null)).setPhaseType(EVERGREEN))
         };
         final DefaultPlan[] childPlans = new DefaultPlan[]{
-                new MockPlan().setName("plan-foo").setProduct(foo).setFinalPhase(new MockPlanPhase().setBillCycleDuration(ANNUAL).setPhaseType(DISCOUNT)),
-                new MockPlan().setName("plan-bar").setProduct(bar).setFinalPhase(new MockPlanPhase().setBillCycleDuration(ANNUAL).setPhaseType(DISCOUNT))
+                new MockPlan().setName("plan-foo").setProduct(foo).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(ANNUAL, null)).setPhaseType(DISCOUNT)),
+                new MockPlan().setName("plan-bar").setProduct(bar).setFinalPhase(new MockPlanPhase().setRecurring(new MockRecurring(ANNUAL, null)).setPhaseType(DISCOUNT))
         };
 
         final PriceListDefault defaultPriceList = new PriceListDefault(defaultPlans);
diff --git a/catalog/src/test/java/org/killbill/billing/catalog/TestVersionedCatalog.java b/catalog/src/test/java/org/killbill/billing/catalog/TestVersionedCatalog.java
index 32a6354..da2cfc2 100644
--- a/catalog/src/test/java/org/killbill/billing/catalog/TestVersionedCatalog.java
+++ b/catalog/src/test/java/org/killbill/billing/catalog/TestVersionedCatalog.java
@@ -51,7 +51,7 @@ public class TestVersionedCatalog extends CatalogTestSuiteNoDB {
 
     @Test(groups = "fast")
     public void testAddCatalog() throws IOException, SAXException, InvalidConfigException, JAXBException, TransformerException, URISyntaxException, ServiceException, CatalogApiException {
-        vc.add(new StandaloneCatalog(new Date()));
+        vc.add((new StandaloneCatalog(new Date()).setCatalogName(vc.getCatalogName()).setRecurringBillingMode(vc.getRecurringBillingMode())));
         Assert.assertEquals(vc.size(), 4);
     }
 
@@ -77,10 +77,10 @@ public class TestVersionedCatalog extends CatalogTestSuiteNoDB {
         final Plan newSubPlan214 = vc.findPlan("pistol-monthly", dt214, dt214);
         final Plan newSubPlan3 = vc.findPlan("pistol-monthly", dt3, dt3);
 
-        Assert.assertEquals(newSubPlan1.getAllPhases()[1].getRecurringPrice().getPrice(Currency.USD), new BigDecimal("1.0"));
-        Assert.assertEquals(newSubPlan2.getAllPhases()[1].getRecurringPrice().getPrice(Currency.USD), new BigDecimal("2.0"));
-        Assert.assertEquals(newSubPlan214.getAllPhases()[1].getRecurringPrice().getPrice(Currency.USD), new BigDecimal("2.0"));
-        Assert.assertEquals(newSubPlan3.getAllPhases()[1].getRecurringPrice().getPrice(Currency.USD), new BigDecimal("3.0"));
+        Assert.assertEquals(newSubPlan1.getAllPhases()[1].getRecurring().getRecurringPrice().getPrice(Currency.USD), new BigDecimal("29.95"));
+        Assert.assertEquals(newSubPlan2.getAllPhases()[1].getRecurring().getRecurringPrice().getPrice(Currency.USD), new BigDecimal("39.95"));
+        Assert.assertEquals(newSubPlan214.getAllPhases()[1].getRecurring().getRecurringPrice().getPrice(Currency.USD), new BigDecimal("39.95"));
+        Assert.assertEquals(newSubPlan3.getAllPhases()[1].getRecurring().getRecurringPrice().getPrice(Currency.USD), new BigDecimal("49.95"));
 
         // Existing subscription
 
@@ -88,9 +88,9 @@ public class TestVersionedCatalog extends CatalogTestSuiteNoDB {
         final Plan exSubPlan214 = vc.findPlan("pistol-monthly", dt214, dt1);
         final Plan exSubPlan3 = vc.findPlan("pistol-monthly", dt3, dt1);
 
-        Assert.assertEquals(exSubPlan2.getAllPhases()[1].getRecurringPrice().getPrice(Currency.USD), new BigDecimal("1.0"));
-        Assert.assertEquals(exSubPlan214.getAllPhases()[1].getRecurringPrice().getPrice(Currency.USD), new BigDecimal("2.0"));
-        Assert.assertEquals(exSubPlan3.getAllPhases()[1].getRecurringPrice().getPrice(Currency.USD), new BigDecimal("2.0"));
+        Assert.assertEquals(exSubPlan2.getAllPhases()[1].getRecurring().getRecurringPrice().getPrice(Currency.USD), new BigDecimal("29.95"));
+        Assert.assertEquals(exSubPlan214.getAllPhases()[1].getRecurring().getRecurringPrice().getPrice(Currency.USD), new BigDecimal("39.95"));
+        Assert.assertEquals(exSubPlan3.getAllPhases()[1].getRecurring().getRecurringPrice().getPrice(Currency.USD), new BigDecimal("39.95"));
 
     }
 
diff --git a/catalog/src/test/resources/SpyCarAdvanced.xml b/catalog/src/test/resources/SpyCarAdvanced.xml
index e6339d6..99eecee 100644
--- a/catalog/src/test/resources/SpyCarAdvanced.xml
+++ b/catalog/src/test/resources/SpyCarAdvanced.xml
@@ -21,9 +21,14 @@
     <effectiveDate>2013-02-08T00:00:00+00:00</effectiveDate>
     <catalogName>SpyCarAdvanced</catalogName>
 
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
+
     <currencies>
         <currency>USD</currency>
         <currency>GBP</currency>
+        <currency>EUR</currency>
+        <currency>JPY</currency>
+        <currency>BTC</currency>
     </currencies>
 
     <products>
@@ -120,10 +125,6 @@
             </billingAlignmentCase>
             <billingAlignmentCase>
                 <billingPeriod>ANNUAL</billingPeriod>
-                <alignment>ACCOUNT</alignment>
-            </billingAlignmentCase>
-            <billingAlignmentCase>
-                <billingPeriod>ANNUAL</billingPeriod>
                 <alignment>SUBSCRIPTION</alignment>
             </billingAlignmentCase>
             <billingAlignmentCase>
@@ -146,6 +147,51 @@
     </rules>
 
     <plans>
+        <plan name="standard-annual">
+            <product>Standard</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>750.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>850.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1000.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>100.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>1.0</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
         <plan name="standard-monthly">
             <product>Standard</product>
             <initialPhases>
@@ -154,26 +200,41 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>75.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>100.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>75.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>85.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>100.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>10.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>0.1</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="sports-monthly">
@@ -184,26 +245,41 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>375.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>500.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>375.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>425.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>500.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>50.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>0.5</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="super-monthly">
@@ -214,26 +290,41 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>750.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>1000.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>750.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>850.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1000.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>100.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>1.0</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="discount-standard-monthly">
@@ -244,43 +335,72 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
                 <phase type="DISCOUNT">
                     <duration>
                         <unit>MONTHS</unit>
                         <number>3</number>
                     </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>50.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>60.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>66.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>6.60</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.06</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
                     <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
                         <price>
                             <currency>GBP</currency>
-                            <value>50.00</value>
+                            <value>75.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>85.00</value>
                         </price>
                         <price>
                             <currency>USD</currency>
-                            <value>66.00</value>
+                            <value>100.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>10.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>0.1</value>
                         </price>
                     </recurringPrice>
-                </phase>
-            </initialPhases>
-            <finalPhase type="EVERGREEN">
-                <duration>
-                    <unit>UNLIMITED</unit>
-                </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>75.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>100.00</value>
-                    </price>
-                </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="discount-sports-monthly">
@@ -291,43 +411,72 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
                 <phase type="DISCOUNT">
                     <duration>
                         <unit>MONTHS</unit>
                         <number>3</number>
                     </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>250.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>300.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>333.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>33.30</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.3</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
                     <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
                         <price>
                             <currency>GBP</currency>
-                            <value>250.00</value>
+                            <value>375.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>425.00</value>
                         </price>
                         <price>
                             <currency>USD</currency>
-                            <value>333.00</value>
+                            <value>500.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>50.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>0.5</value>
                         </price>
                     </recurringPrice>
-                </phase>
-            </initialPhases>
-            <finalPhase type="EVERGREEN">
-                <duration>
-                    <unit>UNLIMITED</unit>
-                </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>375.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>500.00</value>
-                    </price>
-                </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="discount-super-monthly">
@@ -338,87 +487,207 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
                 <phase type="DISCOUNT">
                     <duration>
                         <unit>MONTHS</unit>
                         <number>3</number>
                     </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>500.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>600.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>666.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>66.60</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.6</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
                     <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
                         <price>
                             <currency>GBP</currency>
-                            <value>500.00</value>
+                            <value>750.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>850.00</value>
                         </price>
                         <price>
                             <currency>USD</currency>
-                            <value>666.00</value>
+                            <value>1000.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>100.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>1.0</value>
                         </price>
                     </recurringPrice>
-                </phase>
-            </initialPhases>
-            <finalPhase type="EVERGREEN">
-                <duration>
-                    <unit>UNLIMITED</unit>
-                </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>750.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>1000.00</value>
-                    </price>
-                </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="oilslick-monthly">
             <product>OilSlick</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>2.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>3.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>4.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>0.40</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.01</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>5.95</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>7.95</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>5.95</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>7.95</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>0.80</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>0.01</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="remotecontrol-monthly">
             <product>RemoteControl</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>5.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>7.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>8.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>0.80</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.01</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>15.95</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>17.95</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>15.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>16.95</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>17.95</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>1.79</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>0.01</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
     </plans>
     <priceLists>
         <defaultPriceList name="DEFAULT">
             <plans>
+                <plan>standard-annual</plan>
                 <plan>standard-monthly</plan>
                 <plan>sports-monthly</plan>
                 <plan>super-monthly</plan>
diff --git a/catalog/src/test/resources/SpyCarBasic.xml b/catalog/src/test/resources/SpyCarBasic.xml
index 7db7465..e69cfed 100644
--- a/catalog/src/test/resources/SpyCarBasic.xml
+++ b/catalog/src/test/resources/SpyCarBasic.xml
@@ -16,11 +16,13 @@
   -->
 
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
     <effectiveDate>2013-02-08T00:00:00+00:00</effectiveDate>
     <catalogName>SpyCarBasic</catalogName>
 
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
+
     <currencies>
         <currency>USD</currency>
         <currency>GBP</currency>
@@ -45,7 +47,7 @@
             </changePolicyCase>
         </changePolicy>
         <changeAlignment>
-           <changeAlignmentCase>
+            <changeAlignmentCase>
                 <alignment>START_OF_BUNDLE</alignment>
             </changeAlignmentCase>
         </changeAlignment>
@@ -65,9 +67,9 @@
             </billingAlignmentCase>
         </billingAlignment>
         <priceList>
-           <priceListCase>
+            <priceListCase>
                 <toPriceList>DEFAULT</toPriceList>
-           </priceListCase>
+            </priceListCase>
         </priceList>
     </rules>
 
@@ -80,26 +82,30 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>75.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>100.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>75.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>100.00</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="sports-monthly">
@@ -110,26 +116,29 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>375.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>500.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>375.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>500.00</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="super-monthly">
@@ -140,26 +149,30 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>750.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>1000.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>750.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1000.00</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
     </plans>
diff --git a/catalog/src/test/resources/UsageExperimental.xml b/catalog/src/test/resources/UsageExperimental.xml
new file mode 100644
index 0000000..11f3d17
--- /dev/null
+++ b/catalog/src/test/resources/UsageExperimental.xml
@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+  ~ Copyright 2014 The Billing Project, Inc.
+  ~
+  ~ Ning licenses this file to you under the Apache License, version 2.0
+  ~ (the "License"); you may not use this file except in compliance with the
+  ~ License.  You may obtain a copy of the License at:
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+  ~ License for the specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
+
+    <effectiveDate>2013-02-08T00:00:00+00:00</effectiveDate>
+    <catalogName>Usage</catalogName>
+
+    <!-- TBD
+    Defines the billingMode for all recurring subscription in that catalog:
+    Goal is to avoid to end up in a situation where a user could switch plan and suddenly his
+    recurring billing goes from IN_ADVANCE to IN_ARREAR or the reverse.
+    -->
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
+
+    <currencies>
+        <currency>BTC</currency>
+    </currencies>
+
+    <units>
+        <unit name="members"/>
+        <unit name="cell-phone-minutes"/>
+        <unit name="fastrack-tokens"/>
+        <unit name="bandwith-meg-sec"/>
+        <unit name="Mbytes"/>
+    </units>
+
+    <products>
+        <product name="Dummy">
+            <category>BASE</category>
+        </product>
+        <product name="CapacityInAdvance">
+            <category>BASE</category>
+        </product>
+        <product name="ConsumableInAdvancePrepayCredit">
+            <category>BASE</category>
+        </product>
+        <product name="ConsumableInAdvanceTopUp">
+            <category>BASE</category>
+        </product>
+        <product name="CapacityInArrear">
+            <category>BASE</category>
+        </product>
+        <product name="ConsumableInArrear">
+            <category>BASE</category>
+        </product>
+    </products>
+
+    <rules>
+    </rules>
+
+    <plans>
+
+        <plan name="capacity-in-advance-monthly">
+            <product>CapacityInAdvance</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+
+                <usages>
+                    <usage name="capacity-in-advance-monthly-usage1" billingMode="IN_ADVANCE" usageType="CAPACITY">
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <limits>
+                            <limit>
+                                <unit>members</unit>
+                                <max>100</max>
+                            </limit>
+                        </limits>
+                        <!-- could accept a fixed price and/or a recurring price -->
+                        <recurringPrice>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>100.00</value>
+                            </price>
+                        </recurringPrice>
+                    </usage>
+                </usages>
+            </finalPhase>
+        </plan>
+
+
+        <plan name="consumable-in-advance-prepay-credit-monthly">
+            <product>ConsumableInAdvancePrepayCredit</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <usages>
+                    <usage name="consumable-in-advance-prepay-credit-monthly-usage1" billingMode="IN_ADVANCE" usageType="CONSUMABLE">
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <blocks>
+                            <block>
+                                <unit>cell-phone-minutes</unit>
+                                <size>1000</size>
+                                <!-- could be either fixed (with NO_BILLING_PERIOD) )or recurring:
+                                * In billing period is NO_BILLING_PERIOD, we buy one block of units
+                                * In billing period ha s been specified, we buy one block of units for each period
+                                -->
+                                <prices>
+                                    <price>
+                                        <currency>BTC</currency>
+                                        <value>0.10</value>
+                                    </price>
+                                </prices>
+                            </block>
+                        </blocks>
+                        <!-- We could instead define the price here as we did for capacity-in-advance if we want to 'bundle' linit/units -->
+                    </usage>
+                </usages>
+            </finalPhase>
+        </plan>
+
+
+        <plan name="consumable-in-advance-topup">
+            <product>ConsumableInAdvanceTopUp</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+
+                <usages>
+                    <usage name="consumable-in-advance-topup-usage1" billingMode="IN_ADVANCE" usageType="CONSUMABLE">
+                        <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
+                        <blocks>
+                            <block type="TOP_UP">
+                                <unit>fastrack-tokens</unit>
+                                <size>10</size>
+                                <prices>
+                                    <price>
+                                        <currency>BTC</currency>
+                                        <value>0.10</value>
+                                    </price>
+                                </prices>
+                                <minTopUpCredit>5</minTopUpCredit>
+                            </block>
+                        </blocks>
+                    </usage>
+                </usages>
+            </finalPhase>
+        </plan>
+
+
+        <plan name="capacity-in-arrear">
+            <product>CapacityInArrear</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+
+                <usages>
+                    <usage name="capacity-in-arrear-usage1" billingMode="IN_ARREAR" usageType="CAPACITY">
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <tiers>
+                            <tier>
+                                <limits>
+                                    <limit>
+                                        <unit>bandwith-meg-sec</unit>
+                                        <max>100</max>
+                                    </limit>
+                                    <limit>
+                                        <unit>members</unit>
+                                        <max>500</max>
+                                    </limit>
+                                </limits>
+                                <fixedPrice>
+                                    <price>
+                                        <currency>BTC</currency>
+                                        <value>0.007</value>
+                                    </price>
+                                </fixedPrice>
+                                <recurringPrice>
+                                    <price>
+                                        <currency>BTC</currency>
+                                        <value>0.8</value>
+                                    </price>
+                                </recurringPrice>
+                            </tier>
+                            <tier>
+                                <limits>
+                                    <limit>
+                                        <unit>bandwith-meg-sec</unit>
+                                        <max>100</max>
+                                    </limit>
+                                    <limit>
+                                        <unit>members</unit>
+                                        <max>1000</max>
+                                    </limit>
+                                </limits>
+                                <fixedPrice>
+                                    <price>
+                                        <currency>BTC</currency>
+                                        <value>0.4</value>
+                                    </price>
+                                </fixedPrice>
+                                <recurringPrice>
+                                    <price>
+                                        <currency>BTC</currency>
+                                        <value>1.2</value>
+                                    </price>
+                                </recurringPrice>
+                            </tier>
+                        </tiers>
+                    </usage>
+                </usages>
+            </finalPhase>
+        </plan>
+
+
+        <plan name="consumable-in-arrear">
+            <product>ConsumableInArrear</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <usages>
+                    <usage name="consumable-in-arrear-usage1" billingMode="IN_ARREAR" usageType="CONSUMABLE">
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <tiers>
+                            <tier>
+                                <blocks>
+                                    <tieredBlock>
+                                        <unit>cell-phone-minutes</unit>
+                                        <size>1000</size>
+                                        <prices>
+                                            <price>
+                                                <currency>BTC</currency>
+                                                <value>0.5</value>
+                                            </price>
+                                        </prices>
+                                        <max>10000</max>
+                                    </tieredBlock>
+                                    <tieredBlock>
+                                        <unit>Mbytes</unit>
+                                        <size>512</size>
+                                        <prices>
+                                            <price>
+                                                <currency>BTC</currency>
+                                                <value>0.3</value>
+                                            </price>
+                                        </prices>
+                                        <max>512000</max>
+                                    </tieredBlock>
+                                </blocks>
+                            </tier>
+                        </tiers>
+                    </usage>
+                </usages>
+            </finalPhase>
+        </plan>
+
+
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>capacity-in-advance-monthly</plan>
+                <plan>consumable-in-advance-prepay-credit-monthly</plan>
+                <plan>consumable-in-advance-topup</plan>
+                <plan>capacity-in-arrear</plan>
+                <plan>consumable-in-arrear</plan>
+            </plans>
+        </defaultPriceList>
+    </priceLists>
+</catalog>
diff --git a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-1.xml b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-1.xml
index 03780a3..978b238 100644
--- a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-1.xml
+++ b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-1.xml
@@ -16,48 +16,65 @@
   -->
 
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="../CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
-	<effectiveDate>2011-01-01T00:00:00+00:00</effectiveDate>
-	<catalogName>WeaponsHireSmall</catalogName>
+    <effectiveDate>2011-01-01T00:00:00+00:00</effectiveDate>
+    <catalogName>WeaponsHireSmall</catalogName>
 
-	<currencies>
-		<currency>USD</currency>
-		<currency>EUR</currency>
-		<currency>GBP</currency>
-	</currencies>
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
 
-	<products>
-		<product name="Pistol">
-			<category>BASE</category>
-		</product>
-		<product name="Shotgun">
-			<category>BASE</category>
-		</product>
-		<product name="Laser-Scope">
-			<category>ADD_ON</category>
-		</product>
-	</products>
-	 
-	<rules>
-		<changePolicy>
-			<changePolicyCase> 
-				<fromBillingPeriod>MONTHLY</fromBillingPeriod>
-				<toProduct>Shotgun</toProduct>
-				<toBillingPeriod>MONTHLY</toBillingPeriod>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-			<changePolicyCase> 
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>	
-		</changePolicy>
-		<changeAlignment>
-			<changeAlignmentCase>
-				<alignment>START_OF_SUBSCRIPTION</alignment>
-			</changeAlignmentCase>
-		</changeAlignment>
-		 <createAlignment>
+    <currencies>
+        <currency>USD</currency>
+        <currency>EUR</currency>
+        <currency>GBP</currency>
+    </currencies>
+
+    <units>
+        <unit name="targets"/>
+        <unit name="misfires"/>
+        <unit name="shells"/>
+    </units>
+
+    <products>
+        <product name="Pistol">
+            <category>BASE</category>
+        </product>
+        <product name="Shotgun">
+            <category>BASE</category>
+            <limits>
+                <limit>
+                    <unit>shells</unit>
+                    <max>300</max>
+                </limit>
+            </limits>
+        </product>
+        <product name="Laser-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Extra-Ammo">
+            <category>ADD_ON</category>
+        </product>
+    </products>
+
+    <rules>
+        <changePolicy>
+            <changePolicyCase>
+                <fromBillingPeriod>MONTHLY</fromBillingPeriod>
+                <toProduct>Shotgun</toProduct>
+                <toBillingPeriod>MONTHLY</toBillingPeriod>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+        </changePolicy>
+        <changeAlignment>
+            <changeAlignmentCase>
+                <alignment>START_OF_SUBSCRIPTION</alignment>
+            </changeAlignmentCase>
+        </changeAlignment>
+        <createAlignment>
             <createAlignmentCase>
                 <product>Laser-Scope</product>
                 <alignment>START_OF_SUBSCRIPTION</alignment>
@@ -66,93 +83,200 @@
                 <alignment>START_OF_BUNDLE</alignment>
             </createAlignmentCase>
         </createAlignment>
-	</rules>
- 
-	<plans>
-		<plan name="pistol-monthly">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice> <!-- empty price implies $0 -->
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>GBP</currency><value>1.0</value></price>
-					<price><currency>EUR</currency><value>1.0</value></price> 
-					<price><currency>USD</currency><value>1.0</value></price>								
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-monthly">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice></fixedPrice>
-				    <!-- no price implies $0 -->
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-					<number>-1</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>249.95</value></price>								
-					<price><currency>EUR</currency><value>149.95</value></price>
-					<price><currency>GBP</currency><value>169.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>2399.95</value></price>								
-					<price><currency>EUR</currency><value>1499.95</value></price>
-					<price><currency>GBP</currency><value>1699.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-	</plans>
-	<priceLists>
-		<defaultPriceList name="DEFAULT">			
-				<plans>	
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>shotgun-annual</plan>
-			</plans>
-		</defaultPriceList>
-	</priceLists>
+    </rules>
+
+    <plans>
+        <plan name="pistol-monthly">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>29.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>29.95</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>29.95</value>
+                        </price>
+                    </recurringPrice>
+                    <!--
+                    <limits>
+                        <limit>
+                            <unit>targets</unit>
+                            <min>3</min>
+                        </limit>
+                        <limit>
+                            <unit>misfires</unit>
+                            <max>20</max>
+                        </limit>
+                    </limits>
+                    -->
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-monthly">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                    <number>-1</number>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>249.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>149.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>169.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>2399.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1699.95</value>
+                        </price>
+                    </recurringPrice>
+                    <!--
+                    <limits>
+                        <limit>
+                            <unit>shells</unit>
+                            <max>200</max>
+                        </limit>
+                    </limits>
+                    -->
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="laser-scope-monthly">
+            <product>Laser-Scope</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="extra-ammo-monthly">
+            <product>Extra-Ammo</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>shotgun-annual</plan>
+            </plans>
+        </defaultPriceList>
+    </priceLists>
 </catalog>
diff --git a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-2.xml b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-2.xml
index 5d3a927..9801e42 100644
--- a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-2.xml
+++ b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-2.xml
@@ -16,48 +16,65 @@
   -->
 
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="../CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
-	<effectiveDate>2011-02-02T00:00:00+00:00</effectiveDate>
-	<catalogName>WeaponsHireSmall</catalogName>
+    <effectiveDate>2011-02-02T00:00:00+00:00</effectiveDate>
+    <catalogName>WeaponsHireSmall</catalogName>
 
-	<currencies>
-		<currency>USD</currency>
-		<currency>EUR</currency>
-		<currency>GBP</currency>
-	</currencies>
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
 
-	<products>
-		<product name="Pistol">
-			<category>BASE</category>
-		</product>
-		<product name="Shotgun">
-			<category>BASE</category>
-		</product>
-		<product name="Laser-Scope">
-			<category>ADD_ON</category>
-		</product>
-	</products>
-	 
-	<rules>
-		<changePolicy>
-			<changePolicyCase> 
-				<fromBillingPeriod>MONTHLY</fromBillingPeriod>
-				<toProduct>Shotgun</toProduct>
-				<toBillingPeriod>MONTHLY</toBillingPeriod>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-			<changePolicyCase> 
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>	
-		</changePolicy>
-		<changeAlignment>
-			<changeAlignmentCase>
-				<alignment>START_OF_SUBSCRIPTION</alignment>
-			</changeAlignmentCase>
-		</changeAlignment>
-		 <createAlignment>
+    <currencies>
+        <currency>USD</currency>
+        <currency>EUR</currency>
+        <currency>GBP</currency>
+    </currencies>
+
+    <units>
+        <unit name="targets"/>
+        <unit name="misfires"/>
+        <unit name="shells"/>
+    </units>
+
+    <products>
+        <product name="Pistol">
+            <category>BASE</category>
+        </product>
+        <product name="Shotgun">
+            <category>BASE</category>
+            <limits>
+                <limit>
+                    <unit>shells</unit>
+                    <max>300</max>
+                </limit>
+            </limits>
+        </product>
+        <product name="Laser-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Extra-Ammo">
+            <category>ADD_ON</category>
+        </product>
+    </products>
+
+    <rules>
+        <changePolicy>
+            <changePolicyCase>
+                <fromBillingPeriod>MONTHLY</fromBillingPeriod>
+                <toProduct>Shotgun</toProduct>
+                <toBillingPeriod>MONTHLY</toBillingPeriod>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+        </changePolicy>
+        <changeAlignment>
+            <changeAlignmentCase>
+                <alignment>START_OF_SUBSCRIPTION</alignment>
+            </changeAlignmentCase>
+        </changeAlignment>
+        <createAlignment>
             <createAlignmentCase>
                 <product>Laser-Scope</product>
                 <alignment>START_OF_SUBSCRIPTION</alignment>
@@ -66,94 +83,202 @@
                 <alignment>START_OF_BUNDLE</alignment>
             </createAlignmentCase>
         </createAlignment>
-	</rules>
+    </rules>
+
+    <plans>
+        <plan name="pistol-monthly">
+            <effectiveDateForExistingSubscriptons>2011-02-14T00:00:00+00:00</effectiveDateForExistingSubscriptons>
+
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>39.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>39.95</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>39.95</value>
+                        </price>
+                    </recurringPrice>
+                    <!--
+                    <limits>
+                        <limit>
+                            <unit>targets</unit>
+                            <min>3</min>
+                        </limit>
+                        <limit>
+                            <unit>misfires</unit>
+                            <max>20</max>
+                        </limit>
+                    </limits>
+                    -->
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-monthly">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                    <number>-1</number>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>249.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>149.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>169.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>2399.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1699.95</value>
+                        </price>
+                    </recurringPrice>
+                    <!--
+                    <limits>
+                        <limit>
+                            <unit>shells</unit>
+                            <max>200</max>
+                        </limit>
+                    </limits>
+                    -->
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="laser-scope-monthly">
+            <product>Laser-Scope</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
 
-	<plans>
-		<plan name="pistol-monthly">
-			<effectiveDateForExistingSubscriptons>2011-02-14T00:00:00+00:00</effectiveDateForExistingSubscriptons>
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice> <!-- empty price implies $0 -->
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>GBP</currency><value>2.0</value></price>
-					<price><currency>EUR</currency><value>2.0</value></price> 
-					<price><currency>USD</currency><value>2.0</value></price>								
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-monthly">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice></fixedPrice>
-				    <!-- no price implies $0 -->
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-					<number>-1</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>249.95</value></price>								
-					<price><currency>EUR</currency><value>149.95</value></price>
-					<price><currency>GBP</currency><value>169.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>2399.95</value></price>								
-					<price><currency>EUR</currency><value>1499.95</value></price>
-					<price><currency>GBP</currency><value>1699.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-	</plans>
-	<priceLists>
-		<defaultPriceList name="DEFAULT">			
-				<plans>	
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>shotgun-annual</plan>
-			</plans>
-		</defaultPriceList>
-	</priceLists>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="extra-ammo-monthly">
+            <product>Extra-Ammo</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>shotgun-annual</plan>
+            </plans>
+        </defaultPriceList>
+    </priceLists>
 </catalog>
diff --git a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-3.xml b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-3.xml
index f464408..453a143 100644
--- a/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-3.xml
+++ b/catalog/src/test/resources/versionedCatalog/WeaponsHireSmall-3.xml
@@ -16,48 +16,65 @@
   -->
 
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="../CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
-	<effectiveDate>2011-03-03T00:00:00+00:00</effectiveDate>
-	<catalogName>WeaponsHireSmall</catalogName>
+    <effectiveDate>2011-03-03T00:00:00+00:00</effectiveDate>
+    <catalogName>WeaponsHireSmall</catalogName>
 
-	<currencies>
-		<currency>USD</currency>
-		<currency>EUR</currency>
-		<currency>GBP</currency>
-	</currencies>
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
 
-	<products>
-		<product name="Pistol">
-			<category>BASE</category>
-		</product>
-		<product name="Shotgun">
-			<category>BASE</category>
-		</product>
-		<product name="Laser-Scope">
-			<category>ADD_ON</category>
-		</product>
-	</products>
-	 
-	<rules>
-		<changePolicy>
-			<changePolicyCase> 
-				<fromBillingPeriod>MONTHLY</fromBillingPeriod>
-				<toProduct>Shotgun</toProduct>
-				<toBillingPeriod>MONTHLY</toBillingPeriod>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-			<changePolicyCase> 
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>	
-		</changePolicy>
-		<changeAlignment>
-			<changeAlignmentCase>
-				<alignment>START_OF_SUBSCRIPTION</alignment>
-			</changeAlignmentCase>
-		</changeAlignment>
-		 <createAlignment>
+    <currencies>
+        <currency>USD</currency>
+        <currency>EUR</currency>
+        <currency>GBP</currency>
+    </currencies>
+
+    <units>
+        <unit name="targets"/>
+        <unit name="misfires"/>
+        <unit name="shells"/>
+    </units>
+
+    <products>
+        <product name="Pistol">
+            <category>BASE</category>
+        </product>
+        <product name="Shotgun">
+            <category>BASE</category>
+            <limits>
+                <limit>
+                    <unit>shells</unit>
+                    <max>300</max>
+                </limit>
+            </limits>
+        </product>
+        <product name="Laser-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Extra-Ammo">
+            <category>ADD_ON</category>
+        </product>
+    </products>
+
+    <rules>
+        <changePolicy>
+            <changePolicyCase>
+                <fromBillingPeriod>MONTHLY</fromBillingPeriod>
+                <toProduct>Shotgun</toProduct>
+                <toBillingPeriod>MONTHLY</toBillingPeriod>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+        </changePolicy>
+        <changeAlignment>
+            <changeAlignmentCase>
+                <alignment>START_OF_SUBSCRIPTION</alignment>
+            </changeAlignmentCase>
+        </changeAlignment>
+        <createAlignment>
             <createAlignmentCase>
                 <product>Laser-Scope</product>
                 <alignment>START_OF_SUBSCRIPTION</alignment>
@@ -66,93 +83,201 @@
                 <alignment>START_OF_BUNDLE</alignment>
             </createAlignmentCase>
         </createAlignment>
-	</rules>
+    </rules>
+
+    <plans>
+        <plan name="pistol-monthly">
+            <effectiveDateForExistingSubscriptons>2011-03-14T00:00:00+00:00</effectiveDateForExistingSubscriptons>
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>49.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>49.95</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>49.95</value>
+                        </price>
+                    </recurringPrice>
+                    <!--
+                    <limits>
+                        <limit>
+                            <unit>targets</unit>
+                            <min>3</min>
+                        </limit>
+                        <limit>
+                            <unit>misfires</unit>
+                            <max>20</max>
+                        </limit>
+                    </limits>
+                    -->
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-monthly">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                    <number>-1</number>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>249.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>149.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>169.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>2399.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1699.95</value>
+                        </price>
+                    </recurringPrice>
+                    <!--
+                    <limits>
+                        <limit>
+                            <unit>shells</unit>
+                            <max>200</max>
+                        </limit>
+                    </limits>
+                    -->
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="laser-scope-monthly">
+            <product>Laser-Scope</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
 
-	<plans>
-		<plan name="pistol-monthly">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice> <!-- empty price implies $0 -->
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>GBP</currency><value>3.0</value></price>
-					<price><currency>EUR</currency><value>3.0</value></price> 
-					<price><currency>USD</currency><value>3.0</value></price>								
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-monthly">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice></fixedPrice>
-				    <!-- no price implies $0 -->
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-					<number>-1</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>249.95</value></price>								
-					<price><currency>EUR</currency><value>149.95</value></price>
-					<price><currency>GBP</currency><value>169.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>2399.95</value></price>								
-					<price><currency>EUR</currency><value>1499.95</value></price>
-					<price><currency>GBP</currency><value>1699.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-	</plans>
-	<priceLists>
-		<defaultPriceList name="DEFAULT">			
-				<plans>	
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>shotgun-annual</plan>
-			</plans>
-		</defaultPriceList>
-	</priceLists>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="extra-ammo-monthly">
+            <product>Extra-Ammo</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>shotgun-annual</plan>
+            </plans>
+        </defaultPriceList>
+    </priceLists>
 </catalog>
diff --git a/catalog/src/test/resources/WeaponsHire.xml b/catalog/src/test/resources/WeaponsHire.xml
index b941c76..bdf37bb 100644
--- a/catalog/src/test/resources/WeaponsHire.xml
+++ b/catalog/src/test/resources/WeaponsHire.xml
@@ -37,605 +37,872 @@ Use Cases to do:
 
  -->
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
-	<effectiveDate>2011-10-08T00:00:00+00:00</effectiveDate>
-	<catalogName>Firearms</catalogName>
+    <effectiveDate>2011-10-08T00:00:00+00:00</effectiveDate>
+    <catalogName>Firearms</catalogName>
 
-	<currencies>
-		<currency>USD</currency>
-		<currency>EUR</currency>
-		<currency>GBP</currency>
-	</currencies>
-	
-	<products>
-		<product name="Pistol">
-			<category>BASE</category>
-		</product>
-		<product name="Shotgun">
-			<category>BASE</category>
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
+
+    <currencies>
+        <currency>USD</currency>
+        <currency>EUR</currency>
+        <currency>GBP</currency>
+    </currencies>
+
+    <products>
+        <product name="Pistol">
+            <category>BASE</category>
+        </product>
+        <product name="Shotgun">
+            <category>BASE</category>
             <available>
                 <addonProduct>Telescopic-Scope</addonProduct>
                 <addonProduct>Laser-Scope</addonProduct>
             </available>
-		</product>
-		<product name="Assault-Rifle">
-			<category>BASE</category>
-			<included> 
-				<addonProduct>Telescopic-Scope</addonProduct>
-			</included>
-			<available>
-				<addonProduct>Laser-Scope</addonProduct>
-			</available>
-		</product>
-		<product name="Telescopic-Scope">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Laser-Scope">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Holster">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Extra-Ammo">
-			<category>ADD_ON</category>
-		</product>
-		<product name="Refurbish-Maintenance">
-			<category>ADD_ON</category>
-		</product>
-	</products>
-	 
-	<rules>
-		<changePolicy>
-			<changePolicyCase> 
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-            <changePolicyCase> 
+        </product>
+        <product name="Assault-Rifle">
+            <category>BASE</category>
+            <included>
+                <addonProduct>Telescopic-Scope</addonProduct>
+            </included>
+            <available>
+                <addonProduct>Laser-Scope</addonProduct>
+            </available>
+        </product>
+        <product name="Telescopic-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Laser-Scope">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Holster">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Extra-Ammo">
+            <category>ADD_ON</category>
+        </product>
+        <product name="Refurbish-Maintenance">
+            <category>ADD_ON</category>
+        </product>
+    </products>
+
+    <rules>
+        <changePolicy>
+            <changePolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
                 <toProduct>Assault-Rifle</toProduct>
                 <policy>IMMEDIATE</policy>
             </changePolicyCase>
-            <changePolicyCase> 
-                <fromProduct>Pistol</fromProduct>            
+            <changePolicyCase>
+                <fromProduct>Pistol</fromProduct>
                 <toProduct>Shotgun</toProduct>
                 <policy>IMMEDIATE</policy>
             </changePolicyCase>
-			<changePolicyCase> 
-				<toPriceList>rescue</toPriceList>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-			<changePolicyCase> 
-				<fromBillingPeriod>MONTHLY</fromBillingPeriod>
-				<toBillingPeriod>ANNUAL</toBillingPeriod>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>
-			<changePolicyCase> 
-				<fromBillingPeriod>ANNUAL</fromBillingPeriod>
-				<toBillingPeriod>MONTHLY</toBillingPeriod>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-			<changePolicyCase> 
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-		</changePolicy>
-		<changeAlignment>
-			<changeAlignmentCase>
-				<toPriceList>rescue</toPriceList>
-				<alignment>CHANGE_OF_PLAN</alignment>
-			</changeAlignmentCase>
-			<changeAlignmentCase>
-				<fromPriceList>rescue</fromPriceList>
-				<toPriceList>rescue</toPriceList>
-				<alignment>CHANGE_OF_PRICELIST</alignment>
-			</changeAlignmentCase>
+            <changePolicyCase>
+                <toPriceList>rescue</toPriceList>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <fromBillingPeriod>MONTHLY</fromBillingPeriod>
+                <toBillingPeriod>ANNUAL</toBillingPeriod>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <fromBillingPeriod>ANNUAL</fromBillingPeriod>
+                <toBillingPeriod>MONTHLY</toBillingPeriod>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+        </changePolicy>
+        <changeAlignment>
+            <changeAlignmentCase>
+                <toPriceList>rescue</toPriceList>
+                <alignment>CHANGE_OF_PLAN</alignment>
+            </changeAlignmentCase>
+            <changeAlignmentCase>
+                <fromPriceList>rescue</fromPriceList>
+                <toPriceList>rescue</toPriceList>
+                <alignment>CHANGE_OF_PRICELIST</alignment>
+            </changeAlignmentCase>
             <changeAlignmentCase>
                 <alignment>START_OF_SUBSCRIPTION</alignment>
             </changeAlignmentCase>
-		</changeAlignment>
-		<cancelPolicy>
-			<cancelPolicyCase>
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</cancelPolicyCase>
+        </changeAlignment>
+        <cancelPolicy>
+            <cancelPolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </cancelPolicyCase>
             <cancelPolicyCase>
                 <policy>END_OF_TERM</policy>
             </cancelPolicyCase>
-		</cancelPolicy>
-		<createAlignment>
-		    <createAlignmentCase>
-		        <product>Laser-Scope</product>
+        </cancelPolicy>
+        <createAlignment>
+            <createAlignmentCase>
+                <product>Laser-Scope</product>
                 <alignment>START_OF_SUBSCRIPTION</alignment>
             </createAlignmentCase>
             <createAlignmentCase>
                 <alignment>START_OF_BUNDLE</alignment>
             </createAlignmentCase>
-		</createAlignment>
-		<billingAlignment>
-		<billingAlignmentCase>
-			<alignment>ACCOUNT</alignment>
-		</billingAlignmentCase>
-			<billingAlignmentCase>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<alignment>SUBSCRIPTION</alignment>
-			</billingAlignmentCase>
-			<billingAlignmentCase>
-				<productCategory>ADD_ON</productCategory>
-				<alignment>BUNDLE</alignment>
-			</billingAlignmentCase>
-		</billingAlignment>
-		<priceList>
-			<priceListCase>
-				<fromPriceList>rescue</fromPriceList>
-				<toPriceList>DEFAULT</toPriceList>
-			</priceListCase>
-		</priceList>
-	</rules> 
-	
-	<plans>
-		<plan name="pistol-monthly">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice> <!-- empty price implies $0 -->
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>GBP</currency><value>29.95</value></price>
-					<price><currency>EUR</currency><value>29.95</value></price> 
-					<price><currency>USD</currency><value>29.95</value></price>								
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-monthly">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice></fixedPrice>
-				    <!-- no price implies $0 -->
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-					<number>-1</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>249.95</value></price>								
-					<price><currency>EUR</currency><value>149.95</value></price>
-					<price><currency>GBP</currency><value>169.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-monthly">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>599.95</value></price>								
-					<price><currency>EUR</currency><value>349.95</value></price>
-					<price><currency>GBP</currency><value>399.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="pistol-annual">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>199.95</value></price>								
-					<price><currency>EUR</currency><value>199.95</value></price>
-					<price><currency>GBP</currency><value>199.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>2399.95</value></price>								
-					<price><currency>EUR</currency><value>1499.95</value></price>
-					<price><currency>GBP</currency><value>1699.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>5999.95</value></price>								
-					<price><currency>EUR</currency><value>3499.95</value></price>
-					<price><currency>GBP</currency><value>3999.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="pistol-annual-gunclub-discount">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price><currency>USD</currency><value>9.95</value></price>								
-						<price><currency>EUR</currency><value>9.95</value></price>
-						<price><currency>GBP</currency><value>9.95</value></price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>199.95</value></price>								
-					<price><currency>EUR</currency><value>199.95</value></price>
-					<price><currency>GBP</currency><value>199.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual-gunclub-discount">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price><currency>USD</currency><value>19.95</value></price>								
-						<price><currency>EUR</currency><value>49.95</value></price>
-						<price><currency>GBP</currency><value>69.95</value></price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>2399.95</value></price>								
-					<price><currency>EUR</currency><value>1499.95</value></price>
-					<price><currency>GBP</currency><value>1699.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual-gunclub-discount">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>MONTHS</unit>
-						<number>6</number>
-					</duration>
-					<billingPeriod>MONTHLY</billingPeriod>
-					<recurringPrice>
-						<price><currency>USD</currency><value>99.95</value></price>								
-						<price><currency>EUR</currency><value>99.95</value></price>
-						<price><currency>GBP</currency><value>99.95</value></price>
-						</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>5999.95</value></price>								
-					<price><currency>EUR</currency><value>3499.95</value></price>
-					<price><currency>GBP</currency><value>3999.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="laser-scope-monthly">
-		<product>Laser-Scope</product>
-           <initialPhases>
-              <phase type="DISCOUNT">
-                 <duration>
-                    <unit>MONTHS</unit>
-                    <number>1</number>
-                  </duration>
-                 <billingPeriod>MONTHLY</billingPeriod>
+        </createAlignment>
+        <billingAlignment>
+            <billingAlignmentCase>
+                <alignment>ACCOUNT</alignment>
+            </billingAlignmentCase>
+            <billingAlignmentCase>
+                <billingPeriod>ANNUAL</billingPeriod>
+                <alignment>SUBSCRIPTION</alignment>
+            </billingAlignmentCase>
+            <billingAlignmentCase>
+                <productCategory>ADD_ON</productCategory>
+                <alignment>BUNDLE</alignment>
+            </billingAlignmentCase>
+        </billingAlignment>
+        <priceList>
+            <priceListCase>
+                <fromPriceList>rescue</fromPriceList>
+                <toPriceList>DEFAULT</toPriceList>
+            </priceListCase>
+        </priceList>
+    </rules>
+
+    <plans>
+        <plan name="pistol-monthly">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
-                      <price><currency>USD</currency><value>999.95</value></price>                             
-                      <price><currency>EUR</currency><value>499.95</value></price>
-                      <price><currency>GBP</currency><value>999.95</value></price>
-                      </recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>29.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>29.95</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>29.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-monthly">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>1999.95</value></price>								
-					<price><currency>EUR</currency><value>1499.95</value></price>
-					<price><currency>GBP</currency><value>1999.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="telescopic-scope-monthly">
-			<product>Telescopic-Scope</product>
-			<initialPhases>
-              <phase type="DISCOUNT">
-                 <duration>
-                    <unit>MONTHS</unit>
-                    <number>1</number>
-                  </duration>
-                 <billingPeriod>MONTHLY</billingPeriod>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                    <number>-1</number>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>249.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>149.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>169.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-monthly">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>599.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>349.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>399.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="pistol-annual">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>199.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>2399.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1699.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>5999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>3499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>3999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="pistol-annual-gunclub-discount">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>USD</currency>
+                                <value>9.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>9.95</value>
+                            </price>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>9.95</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>199.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual-gunclub-discount">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>USD</currency>
+                                <value>19.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>49.95</value>
+                            </price>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>69.95</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>2399.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1699.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual-gunclub-discount">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>6</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>USD</currency>
+                                <value>99.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>99.95</value>
+                            </price>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>99.95</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>5999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>3499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>3999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="laser-scope-monthly">
+            <product>Laser-Scope</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>USD</currency>
+                                <value>999.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>499.95</value>
+                            </price>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>999.95</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="telescopic-scope-monthly">
+            <product>Telescopic-Scope</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>MONTHS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>USD</currency>
+                                <value>399.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>299.95</value>
+                            </price>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>399.95</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="extra-ammo-monthly">
+            <product>Extra-Ammo</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
-                      <price><currency>USD</currency><value>399.95</value></price>                             
-                      <price><currency>EUR</currency><value>299.95</value></price>
-                      <price><currency>GBP</currency><value>399.95</value></price>
-                      </recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+            <plansAllowedInBundle>-1</plansAllowedInBundle>
+            <!-- arbitrary number of these (multipack) -->
+        </plan>
+        <plan name="holster-monthly-regular">
+            <product>Holster</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>999.95</value></price>								
-					<price><currency>EUR</currency><value>499.95</value></price>
-					<price><currency>GBP</currency><value>999.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="extra-ammo-monthly">
-			<product>Extra-Ammo</product>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>999.95</value></price>								
-					<price><currency>EUR</currency><value>499.95</value></price>
-					<price><currency>GBP</currency><value>999.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-			<plansAllowedInBundle>-1</plansAllowedInBundle> <!-- arbitrary number of these (multipack) -->
-		</plan>
-		<plan name="holster-monthly-regular">
-			<product>Holster</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>199.95</value></price>								
-					<price><currency>EUR</currency><value>199.95</value></price>
-					<price><currency>GBP</currency><value>199.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="holster-monthly-special">
-			<product>Holster</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>199.95</value></price>								
-					<price><currency>EUR</currency><value>199.95</value></price>
-					<price><currency>GBP</currency><value>199.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="assault-rifle-annual-rescue">
-			<product>Assault-Rifle</product>
-			<initialPhases>
-				<phase type="DISCOUNT">
-					<duration>
-						<unit>YEARS</unit>
-						<number>1</number>
-					</duration>
-					<billingPeriod>ANNUAL</billingPeriod>
-					<recurringPrice>
-						<price><currency>USD</currency><value>5999.95</value></price>								
-						<price><currency>EUR</currency><value>3499.95</value></price>
-						<price><currency>GBP</currency><value>3999.95</value></price>
-					</recurringPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>5999.95</value></price>								
-					<price><currency>EUR</currency><value>3499.95</value></price>
-					<price><currency>GBP</currency><value>3999.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="refurbish-maintenance">
-			<product>Refurbish-Maintenance</product>
-			<finalPhase type="FIXEDTERM">
-				<duration>
-					<unit>MONTHS</unit>
-					<number>12</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>199.95</value></price>								
-					<price><currency>EUR</currency><value>199.95</value></price>
-					<price><currency>GBP</currency><value>199.95</value></price>
-				</recurringPrice>
-				<fixedPrice>
-					<price><currency>USD</currency><value>599.95</value></price>								
-					<price><currency>EUR</currency><value>599.95</value></price>
-					<price><currency>GBP</currency><value>599.95</value></price>
-				</fixedPrice>
-			</finalPhase>
-		</plan>
-	</plans>
-	<priceLists>
-		<defaultPriceList name="DEFAULT"> 
-			<plans>
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>assault-rifle-monthly</plan>
-				<plan>pistol-annual</plan>
-				<plan>shotgun-annual</plan>
-				<plan>assault-rifle-annual</plan>
-				<plan>laser-scope-monthly</plan>
-				<plan>telescopic-scope-monthly</plan>
-				<plan>extra-ammo-monthly</plan>
-				<plan>holster-monthly-regular</plan>
-				<plan>refurbish-maintenance</plan>
-			</plans>
-		</defaultPriceList>
-		<childPriceList name="gunclubDiscount">
-			<plans>
-				<plan>pistol-monthly</plan>
-				<plan>shotgun-monthly</plan>
-				<plan>assault-rifle-monthly</plan>
-				<plan>pistol-annual-gunclub-discount</plan>
-				<plan>shotgun-annual-gunclub-discount</plan>
-				<plan>assault-rifle-annual-gunclub-discount</plan>
-				<plan>holster-monthly-special</plan>
-			</plans>
-		</childPriceList>
-		<childPriceList name="rescue">
-			<plans>
-				<plan>assault-rifle-annual-rescue</plan>
-			</plans>
-		</childPriceList>
-	</priceLists>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>199.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="holster-monthly-special">
+            <product>Holster</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>199.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="assault-rifle-annual-rescue">
+            <product>Assault-Rifle</product>
+            <initialPhases>
+                <phase type="DISCOUNT">
+                    <duration>
+                        <unit>YEARS</unit>
+                        <number>1</number>
+                    </duration>
+                    <recurring>
+                        <billingPeriod>ANNUAL</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>USD</currency>
+                                <value>5999.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>3499.95</value>
+                            </price>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>3999.95</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>5999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>3499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>3999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="refurbish-maintenance">
+            <product>Refurbish-Maintenance</product>
+            <finalPhase type="FIXEDTERM">
+                <duration>
+                    <unit>MONTHS</unit>
+                    <number>12</number>
+                </duration>
+                <fixed>
+                    <fixedPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>599.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>599.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>599.95</value>
+                        </price>
+                    </fixedPrice>
+                </fixed>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>199.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>199.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>assault-rifle-monthly</plan>
+                <plan>pistol-annual</plan>
+                <plan>shotgun-annual</plan>
+                <plan>assault-rifle-annual</plan>
+                <plan>laser-scope-monthly</plan>
+                <plan>telescopic-scope-monthly</plan>
+                <plan>extra-ammo-monthly</plan>
+                <plan>holster-monthly-regular</plan>
+                <plan>refurbish-maintenance</plan>
+            </plans>
+        </defaultPriceList>
+        <childPriceList name="gunclubDiscount">
+            <plans>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>assault-rifle-monthly</plan>
+                <plan>pistol-annual-gunclub-discount</plan>
+                <plan>shotgun-annual-gunclub-discount</plan>
+                <plan>assault-rifle-annual-gunclub-discount</plan>
+                <plan>holster-monthly-special</plan>
+            </plans>
+        </childPriceList>
+        <childPriceList name="rescue">
+            <plans>
+                <plan>assault-rifle-annual-rescue</plan>
+            </plans>
+        </childPriceList>
+    </priceLists>
 
 </catalog>
diff --git a/catalog/src/test/resources/WeaponsHireSmall.xml b/catalog/src/test/resources/WeaponsHireSmall.xml
index 5b43feb..c0501d3 100644
--- a/catalog/src/test/resources/WeaponsHireSmall.xml
+++ b/catalog/src/test/resources/WeaponsHireSmall.xml
@@ -16,57 +16,59 @@
   -->
 
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
-	<effectiveDate>2011-10-08T00:00:00+00:00</effectiveDate>
-	<catalogName>WeaponsHireSmall</catalogName>
+    <effectiveDate>2011-10-08T00:00:00+00:00</effectiveDate>
+    <catalogName>WeaponsHireSmall</catalogName>
+
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
+
+    <currencies>
+        <currency>USD</currency>
+        <currency>EUR</currency>
+        <currency>GBP</currency>
+    </currencies>
 
-	<currencies>
-		<currency>USD</currency>
-		<currency>EUR</currency>
-		<currency>GBP</currency>
-	</currencies>
-    
     <units>
         <unit name="targets"/>
         <unit name="misfires"/>
         <unit name="shells"/>
     </units>
 
-	<products>
-		<product name="Pistol">
-			<category>BASE</category>
-		</product>
-		<product name="Shotgun">
-			<category>BASE</category>
-                <limits>
-                    <limit>
-                        <unit>shells</unit>
-                        <max>300</max>
-                    </limit>
-                </limits>
-		</product>
-		<product name="Laser-Scope">
-			<category>ADD_ON</category>
-		</product>
+    <products>
+        <product name="Pistol">
+            <category>BASE</category>
+        </product>
+        <product name="Shotgun">
+            <category>BASE</category>
+            <limits>
+                <limit>
+                    <unit>shells</unit>
+                    <max>300</max>
+                </limit>
+            </limits>
+        </product>
+        <product name="Laser-Scope">
+            <category>ADD_ON</category>
+        </product>
         <product name="Extra-Ammo">
             <category>ADD_ON</category>
         </product>
-	</products>
-	 
-	<rules>
-		<changePolicy>
-			<changePolicyCase> 
-				<fromBillingPeriod>MONTHLY</fromBillingPeriod>
-				<toProduct>Shotgun</toProduct>
-				<toBillingPeriod>MONTHLY</toBillingPeriod>
-				<policy>END_OF_TERM</policy>
-			</changePolicyCase>
-			<changePolicyCase> 
-				<phaseType>TRIAL</phaseType>
-				<policy>IMMEDIATE</policy>
-			</changePolicyCase>	
-		</changePolicy>
+    </products>
+
+    <rules>
+        <changePolicy>
+            <changePolicyCase>
+                <fromBillingPeriod>MONTHLY</fromBillingPeriod>
+                <toProduct>Shotgun</toProduct>
+                <toBillingPeriod>MONTHLY</toBillingPeriod>
+                <policy>END_OF_TERM</policy>
+            </changePolicyCase>
+            <changePolicyCase>
+                <phaseType>TRIAL</phaseType>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+        </changePolicy>
         <changeAlignment>
             <changeAlignmentCase>
                 <alignment>START_OF_SUBSCRIPTION</alignment>
@@ -81,137 +83,234 @@
                 <alignment>START_OF_BUNDLE</alignment>
             </createAlignmentCase>
         </createAlignment>
-	</rules> 
+    </rules>
 
-	<plans>
-		<plan name="pistol-monthly">
-			<product>Pistol</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice> <!-- empty price implies $0 -->
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>GBP</currency><value>29.95</value></price>
-					<price><currency>EUR</currency><value>29.95</value></price> 
-					<price><currency>USD</currency><value>29.95</value></price>								
-				</recurringPrice>
-                <limits>
-                    <limit>
-                        <unit>targets</unit>
-                        <min>3</min>
-                    </limit>
-                    <limit>
-                        <unit>misfires</unit>
-                        <max>20</max>
-                    </limit>
-                </limits>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-monthly">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice></fixedPrice>
-				    <!-- no price implies $0 -->
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-					<number>-1</number>
-				</duration>
-				<billingPeriod>MONTHLY</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>249.95</value></price>								
-					<price><currency>EUR</currency><value>149.95</value></price>
-					<price><currency>GBP</currency><value>169.95</value></price>
-				</recurringPrice>
-			</finalPhase>
-		</plan>
-		<plan name="shotgun-annual">
-			<product>Shotgun</product>
-			<initialPhases>
-				<phase type="TRIAL">
-					<duration>
-						<unit>DAYS</unit>
-						<number>30</number>
-					</duration>
-					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-					<fixedPrice>
-					</fixedPrice>
-				</phase>
-			</initialPhases>
-			<finalPhase type="EVERGREEN">
-				<duration>
-					<unit>UNLIMITED</unit>
-				</duration>
-				<billingPeriod>ANNUAL</billingPeriod>
-				<recurringPrice>
-					<price><currency>USD</currency><value>2399.95</value></price>								
-					<price><currency>EUR</currency><value>1499.95</value></price>
-					<price><currency>GBP</currency><value>1699.95</value></price>
-				</recurringPrice>
-                <limits>
-                    <limit>
-                        <unit>shells</unit>
-                        <max>200</max>
-                    </limit>
-                </limits>
-			</finalPhase>
-		</plan>
-		<plan name="laser-scope-monthly">
-        <product>Laser-Scope</product>
+    <plans>
+        <plan name="pistol-monthly">
+            <product>Pistol</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>29.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>29.95</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>29.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+                <usages>
+                    <usage name="usage1" billingMode="IN_ADVANCE" usageType="CAPACITY">
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <limits>
+                            <limit>
+                                <unit>targets</unit>
+                                <min>3</min>
+                            </limit>
+                            <limit>
+                                <unit>misfires</unit>
+                                <max>20</max>
+                            </limit>
+                        </limits>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>1.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>0.95</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>1.95</value>
+                            </price>
+                        </recurringPrice>
+                    </usage>
+                </usages>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-monthly">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
+                    <number>-1</number>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price><currency>USD</currency><value>1999.95</value></price>                               
-                    <price><currency>EUR</currency><value>1499.95</value></price>
-                    <price><currency>GBP</currency><value>1999.95</value></price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>249.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>149.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>169.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+            </finalPhase>
+        </plan>
+        <plan name="shotgun-annual">
+            <product>Shotgun</product>
+            <initialPhases>
+                <phase type="TRIAL">
+                    <duration>
+                        <unit>DAYS</unit>
+                        <number>30</number>
+                    </duration>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>2399.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1699.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
+                <usages>
+                    <usage name="usage2" billingMode="IN_ADVANCE" usageType="CAPACITY">
+                        <billingPeriod>ANNUAL</billingPeriod>
+                        <limits>
+                            <limit>
+                                <unit>shells</unit>
+                                <max>200</max>
+                            </limit>
+                        </limits>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>1.95</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>0.95</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>1.95</value>
+                            </price>
+                        </recurringPrice>
+                    </usage>
+                </usages>
+            </finalPhase>
+        </plan>
+        <plan name="laser-scope-monthly">
+            <product>Laser-Scope</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
+
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="extra-ammo-monthly">
-        <product>Extra-Ammo</product>
+            <product>Extra-Ammo</product>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price><currency>USD</currency><value>1999.95</value></price>                               
-                    <price><currency>EUR</currency><value>1499.95</value></price>
-                    <price><currency>GBP</currency><value>1999.95</value></price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1999.95</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>1499.95</value>
+                        </price>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>1999.95</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
-	</plans>
-	<priceLists>
-		<defaultPriceList name="DEFAULT">
-				<plans>	
-					<plan>pistol-monthly</plan>
-					<plan>shotgun-monthly</plan>
-				<plan>shotgun-annual</plan>
-			</plans>
-		</defaultPriceList>
-	</priceLists>
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>pistol-monthly</plan>
+                <plan>shotgun-monthly</plan>
+                <plan>shotgun-annual</plan>
+            </plans>
+        </defaultPriceList>
+    </priceLists>
 </catalog>
diff --git a/entitlement/src/main/java/org/killbill/billing/entitlement/api/DefaultSubscriptionBundleTimeline.java b/entitlement/src/main/java/org/killbill/billing/entitlement/api/DefaultSubscriptionBundleTimeline.java
index 1e5003d..3ff2055 100644
--- a/entitlement/src/main/java/org/killbill/billing/entitlement/api/DefaultSubscriptionBundleTimeline.java
+++ b/entitlement/src/main/java/org/killbill/billing/entitlement/api/DefaultSubscriptionBundleTimeline.java
@@ -559,12 +559,12 @@ public class DefaultSubscriptionBundleTimeline implements SubscriptionBundleTime
                                             in.getPreviousPlan(),
                                             in.getPreviousPhase(),
                                             in.getPreviousPriceList(),
-                                            (in.getPreviousPlan() != null ? in.getPreviousPlan().getBillingPeriod() : null),
+                                            (in.getPreviousPlan() != null ? in.getPreviousPlan().getRecurringBillingPeriod() : null),
                                             (in.getNextPlan() != null ? in.getNextPlan().getProduct() : null),
                                             in.getNextPlan(),
                                             in.getNextPhase(),
                                             in.getNextPriceList(),
-                                            (in.getNextPlan() != null ? in.getNextPlan().getBillingPeriod() : null),
+                                            (in.getNextPlan() != null ? in.getNextPlan().getRecurringBillingPeriod() : null),
                                             in.getCreatedDate(),
                                             accountTimeZone);
     }
diff --git a/entitlement/src/test/resources/entitlement.properties b/entitlement/src/test/resources/entitlement.properties
index 357561d..46a797b 100644
--- a/entitlement/src/test/resources/entitlement.properties
+++ b/entitlement/src/test/resources/entitlement.properties
@@ -1 +1 @@
-org.killbill.catalog.uri=file:src/test/resources/catalog.xml
+org.killbill.catalog.uri=catalogTest.xml

invoice/pom.xml 5(+5 -0)

diff --git a/invoice/pom.xml b/invoice/pom.xml
index 8f29a64..dd3b8a2 100644
--- a/invoice/pom.xml
+++ b/invoice/pom.xml
@@ -94,6 +94,11 @@
         </dependency>
         <dependency>
             <groupId>org.kill-bill.billing</groupId>
+            <artifactId>killbill-usage</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.kill-bill.billing</groupId>
             <artifactId>killbill-util</artifactId>
         </dependency>
         <dependency>
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/api/migration/DefaultInvoiceMigrationApi.java b/invoice/src/main/java/org/killbill/billing/invoice/api/migration/DefaultInvoiceMigrationApi.java
index 42dabfd..a9a8a42 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/api/migration/DefaultInvoiceMigrationApi.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/api/migration/DefaultInvoiceMigrationApi.java
@@ -17,6 +17,7 @@
 package org.killbill.billing.invoice.api.migration;
 
 import java.math.BigDecimal;
+import java.util.List;
 import java.util.UUID;
 
 import org.joda.time.DateTime;
@@ -73,10 +74,10 @@ public class DefaultInvoiceMigrationApi implements InvoiceMigrationApi {
 
         final InvoiceModelDao migrationInvoice = new InvoiceModelDao(accountId, clock.getUTCToday(), targetDate, currency, true);
         final InvoiceItemModelDao migrationInvoiceItem = new InvoiceItemModelDao(context.getCreatedDate(), InvoiceItemType.FIXED, migrationInvoice.getId(), accountId, null, null,
-                                                                                 MigrationPlan.MIGRATION_PLAN_NAME, MigrationPlan.MIGRATION_PLAN_PHASE_NAME,
+                                                                                 MigrationPlan.MIGRATION_PLAN_NAME, MigrationPlan.MIGRATION_PLAN_PHASE_NAME, null,
                                                                                  targetDate, null, balance, null, currency, null);
         dao.createInvoice(migrationInvoice, ImmutableList.<InvoiceItemModelDao>of(migrationInvoiceItem),
-                          ImmutableList.<InvoicePaymentModelDao>of(), true, ImmutableMap.<UUID, DateTime>of(), internalCallContextFactory.createInternalCallContext(accountId, context));
+                          ImmutableList.<InvoicePaymentModelDao>of(), true, ImmutableMap.<UUID, List<DateTime>>of(), internalCallContextFactory.createInternalCallContext(accountId, context));
 
         return migrationInvoice.getId();
     }
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/calculator/InvoiceCalculatorUtils.java b/invoice/src/main/java/org/killbill/billing/invoice/calculator/InvoiceCalculatorUtils.java
index 14ffe3f..472b796 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/calculator/InvoiceCalculatorUtils.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/calculator/InvoiceCalculatorUtils.java
@@ -60,6 +60,7 @@ public abstract class InvoiceCalculatorUtils {
     public static boolean isCharge(final InvoiceItem invoiceItem) {
         return InvoiceItemType.EXTERNAL_CHARGE.equals(invoiceItem.getInvoiceItemType()) ||
                InvoiceItemType.FIXED.equals(invoiceItem.getInvoiceItemType()) ||
+               InvoiceItemType.USAGE.equals(invoiceItem.getInvoiceItemType()) ||
                InvoiceItemType.RECURRING.equals(invoiceItem.getInvoiceItemType());
     }
 
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/dao/DefaultInvoiceDao.java b/invoice/src/main/java/org/killbill/billing/invoice/dao/DefaultInvoiceDao.java
index 695f05b..782a04c 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/dao/DefaultInvoiceDao.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/dao/DefaultInvoiceDao.java
@@ -201,7 +201,7 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
 
     @Override
     public void createInvoice(final InvoiceModelDao invoice, final List<InvoiceItemModelDao> invoiceItems,
-                              final List<InvoicePaymentModelDao> invoicePayments, final boolean isRealInvoice, final Map<UUID, DateTime> callbackDateTimePerSubscriptions,
+                              final List<InvoicePaymentModelDao> invoicePayments, final boolean isRealInvoice, final Map<UUID, List<DateTime>> callbackDateTimePerSubscriptions,
                               final InternalCallContext context) {
         transactionalSqlDao.execute(new EntitySqlDaoTransactionWrapper<Void>() {
             @Override
@@ -402,7 +402,7 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
                     final BigDecimal requestedPositiveAmountToAdjust = requestedPositiveAmount.compareTo(maxBalanceToAdjust) > 0 ? maxBalanceToAdjust : requestedPositiveAmount;
                     if (requestedPositiveAmountToAdjust.compareTo(BigDecimal.ZERO) > 0) {
                         final InvoiceItemModelDao adjItem = new InvoiceItemModelDao(context.getCreatedDate(), InvoiceItemType.REFUND_ADJ, invoice.getId(), invoice.getAccountId(),
-                                                                                    null, null, null, null, context.getCreatedDate().toLocalDate(), null,
+                                                                                    null, null, null, null, null, context.getCreatedDate().toLocalDate(), null,
                                                                                     requestedPositiveAmountToAdjust.negate(), null, invoice.getCurrency(), null);
                         transInvoiceItemDao.create(adjItem, context);
                     }
@@ -570,7 +570,7 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
 
                 final InvoiceItemModelDao externalCharge = new InvoiceItemModelDao(context.getCreatedDate(), InvoiceItemType.EXTERNAL_CHARGE,
                                                                                    invoiceIdForExternalCharge, accountId,
-                                                                                   bundleId, null, description, null,
+                                                                                   bundleId, null, description, null, null,
                                                                                    effectiveDate, null, amount, null,
                                                                                    currency, null);
                 final InvoiceItemSqlDao transInvoiceItemDao = entitySqlDaoWrapperFactory.become(InvoiceItemSqlDao.class);
@@ -620,7 +620,7 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
 
                 // Note! The amount is negated here!
                 final InvoiceItemModelDao credit = new InvoiceItemModelDao(context.getCreatedDate(), InvoiceItemType.CREDIT_ADJ, invoiceIdForCredit,
-                                                                           accountId, null, null, null, null, effectiveDate,
+                                                                           accountId, null, null, null, null, null, effectiveDate,
                                                                            null, positiveCreditAmount.negate(), null,
                                                                            currency, null);
                 invoiceDaoHelper.insertItem(entitySqlDaoWrapperFactory, credit, context);
@@ -677,8 +677,8 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
 
                 // First, adjust the same invoice with the CBA amount to "delete"
                 final InvoiceItemModelDao cbaAdjItem = new InvoiceItemModelDao(context.getCreatedDate(), InvoiceItemType.CBA_ADJ, invoice.getId(), invoice.getAccountId(),
-                                                                               null, null, null, null, context.getCreatedDate().toLocalDate(),
-                                                                               null, cbaItem.getAmount().negate(), null, cbaItem.getCurrency(), cbaItem.getId());
+                                                                               null, null, null, null, null, context.getCreatedDate().toLocalDate(),
+                                                                               null, cbaItem.getAmount().negate(), null,  cbaItem.getCurrency(), cbaItem.getId());
                 invoiceItemSqlDao.create(cbaAdjItem, context);
 
                 // Verify the final invoice balance is not negative
@@ -733,7 +733,7 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
 
                         // Add the adjustment on that invoice
                         final InvoiceItemModelDao nextCBAAdjItem = new InvoiceItemModelDao(context.getCreatedDate(), InvoiceItemType.CBA_ADJ, invoiceFollowing.getId(),
-                                                                                           invoice.getAccountId(), null, null, null, null,
+                                                                                           invoice.getAccountId(), null, null, null, null, null,
                                                                                            context.getCreatedDate().toLocalDate(), null,
                                                                                            positiveCBAAdjItemAmount, null, cbaItem.getCurrency(), cbaItem.getId());
                         invoiceItemSqlDao.create(nextCBAAdjItem, context);
@@ -760,10 +760,12 @@ public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao, Invoice, I
     }
 
     private void notifyOfFutureBillingEvents(final EntitySqlDaoWrapperFactory<EntitySqlDao> entitySqlDaoWrapperFactory, final UUID accountId,
-                                             final Map<UUID, DateTime> callbackDateTimePerSubscriptions, final UUID userToken) {
+                                             final Map<UUID, List<DateTime>> callbackDateTimePerSubscriptions, final UUID userToken) {
         for (final UUID subscriptionId : callbackDateTimePerSubscriptions.keySet()) {
-            final DateTime callbackDateTimeUTC = callbackDateTimePerSubscriptions.get(subscriptionId);
-            nextBillingDatePoster.insertNextBillingNotificationFromTransaction(entitySqlDaoWrapperFactory, accountId, subscriptionId, callbackDateTimeUTC, userToken);
+            final List<DateTime> callbackDateTimeUTC = callbackDateTimePerSubscriptions.get(subscriptionId);
+            for (DateTime cur : callbackDateTimeUTC) {
+                nextBillingDatePoster.insertNextBillingNotificationFromTransaction(entitySqlDaoWrapperFactory, accountId, subscriptionId, cur, userToken);
+            }
         }
     }
 
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceDao.java b/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceDao.java
index 8b8cd3f..5adb05e 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceDao.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceDao.java
@@ -37,7 +37,7 @@ import org.killbill.billing.util.entity.dao.EntityDao;
 public interface InvoiceDao extends EntityDao<InvoiceModelDao, Invoice, InvoiceApiException> {
 
     void createInvoice(InvoiceModelDao invoice, List<InvoiceItemModelDao> invoiceItems,
-                       List<InvoicePaymentModelDao> invoicePayments, boolean isRealInvoice, final Map<UUID, DateTime> callbackDateTimePerSubscriptions, InternalCallContext context);
+                       List<InvoicePaymentModelDao> invoicePayments, boolean isRealInvoice, final Map<UUID, List<DateTime>> callbackDateTimePerSubscriptions, InternalCallContext context);
 
     InvoiceModelDao getByNumber(Integer number, InternalTenantContext context) throws InvoiceApiException;
 
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceDaoHelper.java b/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceDaoHelper.java
index 7460118..00290d1 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceDaoHelper.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceDaoHelper.java
@@ -203,7 +203,7 @@ public class InvoiceDaoHelper {
         // Finally, create the adjustment
         // Note! The amount is negated here!
         return new InvoiceItemModelDao(context.getCreatedDate(), InvoiceItemType.ITEM_ADJ, invoiceItemToBeAdjusted.getInvoiceId(), invoiceItemToBeAdjusted.getAccountId(),
-                                       null, null, null, null, effectiveDate, effectiveDate, amountToAdjust.negate(), null, currencyForAdjustment, invoiceItemToBeAdjusted.getId());
+                                       null, null, null, null, null, effectiveDate, effectiveDate, amountToAdjust.negate(), null, currencyForAdjustment, invoiceItemToBeAdjusted.getId());
     }
 
     /**
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceItemModelDao.java b/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceItemModelDao.java
index 2729793..84177e8 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceItemModelDao.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/dao/InvoiceItemModelDao.java
@@ -38,6 +38,7 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
     private UUID subscriptionId;
     private String planName;
     private String phaseName;
+    private String usageName;
     private LocalDate startDate;
     private LocalDate endDate;
     private BigDecimal amount;
@@ -49,7 +50,7 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
 
     public InvoiceItemModelDao(final UUID id, final DateTime createdDate, final InvoiceItemType type, final UUID invoiceId,
                                final UUID accountId, final UUID bundleId, final UUID subscriptionId, final String planName,
-                               final String phaseName, final LocalDate startDate, final LocalDate endDate, final BigDecimal amount,
+                               final String phaseName, final String usageName, final LocalDate startDate, final LocalDate endDate, final BigDecimal amount,
                                final BigDecimal rate, final Currency currency, final UUID linkedItemId) {
         super(id, createdDate, createdDate);
         this.type = type;
@@ -59,6 +60,7 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
         this.subscriptionId = subscriptionId;
         this.planName = planName;
         this.phaseName = phaseName;
+        this.usageName = usageName;
         this.startDate = startDate;
         this.endDate = endDate;
         this.amount = amount;
@@ -69,15 +71,15 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
 
     public InvoiceItemModelDao(final DateTime createdDate, final InvoiceItemType type, final UUID invoiceId, final UUID accountId,
                                final UUID bundleId, final UUID subscriptionId, final String planName,
-                               final String phaseName, final LocalDate startDate, final LocalDate endDate, final BigDecimal amount,
+                               final String phaseName, final String usageName, final LocalDate startDate, final LocalDate endDate, final BigDecimal amount,
                                final BigDecimal rate, final Currency currency, final UUID linkedItemId) {
-        this(UUID.randomUUID(), createdDate, type, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName,
+        this(UUID.randomUUID(), createdDate, type, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName,
              startDate, endDate, amount, rate, currency, linkedItemId);
     }
 
     public InvoiceItemModelDao(final InvoiceItem invoiceItem) {
         this(invoiceItem.getId(), invoiceItem.getCreatedDate(), invoiceItem.getInvoiceItemType(), invoiceItem.getInvoiceId(), invoiceItem.getAccountId(), invoiceItem.getBundleId(),
-             invoiceItem.getSubscriptionId(), invoiceItem.getPlanName(), invoiceItem.getPhaseName(), invoiceItem.getStartDate(), invoiceItem.getEndDate(),
+             invoiceItem.getSubscriptionId(), invoiceItem.getPlanName(), invoiceItem.getPhaseName(), invoiceItem.getUsageName(), invoiceItem.getStartDate(), invoiceItem.getEndDate(),
              invoiceItem.getAmount(), invoiceItem.getRate(), invoiceItem.getCurrency(), invoiceItem.getLinkedItemId());
     }
 
@@ -109,6 +111,10 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
         return phaseName;
     }
 
+    public String getUsageName() {
+        return usageName;
+    }
+
     public LocalDate getStartDate() {
         return startDate;
     }
@@ -161,6 +167,10 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
         this.phaseName = phaseName;
     }
 
+    public void setUsageName(final String usageName) {
+        this.usageName = usageName;
+    }
+
     public void setStartDate(final LocalDate startDate) {
         this.startDate = startDate;
     }
@@ -196,6 +206,7 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
         sb.append(", subscriptionId=").append(subscriptionId);
         sb.append(", planName='").append(planName).append('\'');
         sb.append(", phaseName='").append(phaseName).append('\'');
+        sb.append(", usageName='").append(usageName).append('\'');
         sb.append(", startDate=").append(startDate);
         sb.append(", endDate=").append(endDate);
         sb.append(", amount=").append(amount);
@@ -247,6 +258,9 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
         if (planName != null ? !planName.equals(that.planName) : that.planName != null) {
             return false;
         }
+        if (usageName != null ? !usageName.equals(that.usageName) : that.usageName != null) {
+            return false;
+        }
         if (rate != null ? rate.compareTo(that.rate) != 0 : that.rate != null) {
             return false;
         }
@@ -273,6 +287,7 @@ public class InvoiceItemModelDao extends EntityBase implements EntityModelDao<In
         result = 31 * result + (subscriptionId != null ? subscriptionId.hashCode() : 0);
         result = 31 * result + (planName != null ? planName.hashCode() : 0);
         result = 31 * result + (phaseName != null ? phaseName.hashCode() : 0);
+        result = 31 * result + (usageName != null ? usageName.hashCode() : 0);
         result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
         result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
         result = 31 * result + (amount != null ? amount.hashCode() : 0);
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/generator/DefaultInvoiceGenerator.java b/invoice/src/main/java/org/killbill/billing/invoice/generator/DefaultInvoiceGenerator.java
index 10d8bc8..6b4d6d8 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/generator/DefaultInvoiceGenerator.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/generator/DefaultInvoiceGenerator.java
@@ -18,6 +18,7 @@ package org.killbill.billing.invoice.generator;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.UUID;
@@ -26,17 +27,18 @@ import javax.annotation.Nullable;
 
 import org.joda.time.LocalDate;
 import org.joda.time.Months;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.killbill.billing.ErrorCode;
+import org.killbill.billing.ObjectType;
+import org.killbill.billing.callcontext.InternalCallContext;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.CatalogApiException;
 import org.killbill.billing.catalog.api.Currency;
-import org.killbill.clock.Clock;
 import org.killbill.billing.invoice.api.Invoice;
 import org.killbill.billing.invoice.api.InvoiceApiException;
 import org.killbill.billing.invoice.api.InvoiceItem;
-import org.killbill.billing.invoice.model.BillingMode;
+import org.killbill.billing.invoice.api.InvoiceItemType;
+import org.killbill.billing.invoice.model.BillingModeGenerator;
 import org.killbill.billing.invoice.model.DefaultInvoice;
 import org.killbill.billing.invoice.model.FixedPriceInvoiceItem;
 import org.killbill.billing.invoice.model.InAdvanceBillingMode;
@@ -44,12 +46,22 @@ import org.killbill.billing.invoice.model.InvalidDateSequenceException;
 import org.killbill.billing.invoice.model.RecurringInvoiceItem;
 import org.killbill.billing.invoice.model.RecurringInvoiceItemData;
 import org.killbill.billing.invoice.tree.AccountItemTree;
+import org.killbill.billing.invoice.usage.SubscriptionConsumableInArrear;
 import org.killbill.billing.junction.BillingEvent;
 import org.killbill.billing.junction.BillingEventSet;
-import org.killbill.billing.junction.BillingModeType;
+import org.killbill.billing.usage.api.UsageUserApi;
 import org.killbill.billing.util.config.InvoiceConfig;
 import org.killbill.billing.util.currency.KillBillMoney;
+import org.killbill.billing.util.dao.NonEntityDao;
+import org.killbill.clock.Clock;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 import com.google.inject.Inject;
 
 public class DefaultInvoiceGenerator implements InvoiceGenerator {
@@ -58,11 +70,15 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
 
     private final Clock clock;
     private final InvoiceConfig config;
+    private final UsageUserApi usageApi;
+    private final NonEntityDao nonEntityDao;
 
     @Inject
-    public DefaultInvoiceGenerator(final Clock clock, final InvoiceConfig config) {
+    public DefaultInvoiceGenerator(final Clock clock, final UsageUserApi usageApi, final InvoiceConfig config, final NonEntityDao nonEntityDao) {
         this.clock = clock;
         this.config = config;
+        this.usageApi = usageApi;
+        this.nonEntityDao = nonEntityDao;
     }
 
     /*
@@ -72,7 +88,7 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
     public Invoice generateInvoice(final UUID accountId, @Nullable final BillingEventSet events,
                                    @Nullable final List<Invoice> existingInvoices,
                                    final LocalDate targetDate,
-                                   final Currency targetCurrency) throws InvoiceApiException {
+                                   final Currency targetCurrency, final InternalCallContext context) throws InvoiceApiException {
         if ((events == null) || (events.size() == 0) || events.isAccountAutoInvoiceOff()) {
             return null;
         }
@@ -86,19 +102,84 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
         final List<InvoiceItem> inAdvanceItems = generateInAdvanceInvoiceItems(accountId, invoiceId, events, existingInvoices, adjustedTargetDate, targetCurrency);
         invoice.addInvoiceItems(inAdvanceItems);
 
-        return inAdvanceItems.size() != 0 ? invoice : null;
+        final List<InvoiceItem> usageItems = generateUsageInvoiceItems(invoiceId, events, existingInvoices, targetDate, context);
+        invoice.addInvoiceItems(usageItems);
+
+        return invoice.getInvoiceItems().size() != 0 ? invoice : null;
+    }
+
+    // STEPH_USAGE Only deals with consumable in arrear usage billing.
+    private List<InvoiceItem> generateUsageInvoiceItems(final UUID invoiceId, final BillingEventSet eventSet,
+                                                        @Nullable final List<Invoice> existingInvoices, final LocalDate targetDate,
+                                                        final InternalCallContext context) throws InvoiceApiException {
+
+        final UUID tenantId = nonEntityDao.retrieveIdFromObject(context.getTenantRecordId(), ObjectType.TENANT);
+        try {
+
+            final List<InvoiceItem> items = Lists.newArrayList();
+            final Iterator<BillingEvent> events = eventSet.iterator();
+
+            List<BillingEvent> curEvents = Lists.newArrayList();
+            UUID curSubscriptionId = null;
+            while (events.hasNext()) {
+                final BillingEvent event = events.next();
+                // Skip events that are posterior to the targetDate
+                final LocalDate eventLocalEffectiveDate =  new LocalDate(event.getEffectiveDate(), event.getAccount().getTimeZone());
+                if (eventLocalEffectiveDate.isAfter(targetDate)) {
+                    continue;
+                }
+
+                final UUID subscriptionId = event.getSubscription().getId();
+                if (curSubscriptionId != null && !curSubscriptionId.equals(subscriptionId)) {
+                    final SubscriptionConsumableInArrear subscriptionConsumableInArrear = new SubscriptionConsumableInArrear(invoiceId, curEvents, usageApi, targetDate, context.toTenantContext(tenantId));
+                    items.addAll(subscriptionConsumableInArrear.computeMissingUsageInvoiceItems(extractUsageItemsForSubscription(curSubscriptionId, existingInvoices)));
+                    curEvents = Lists.newArrayList();
+                }
+                curSubscriptionId = subscriptionId;
+                curEvents.add(event);
+            }
+            if (curSubscriptionId != null) {
+                final SubscriptionConsumableInArrear subscriptionConsumableInArrear = new SubscriptionConsumableInArrear(invoiceId, curEvents, usageApi, targetDate, context.toTenantContext(tenantId));
+                items.addAll(subscriptionConsumableInArrear.computeMissingUsageInvoiceItems(extractUsageItemsForSubscription(curSubscriptionId, existingInvoices)));
+            }
+            return items;
+
+        } catch (CatalogApiException e) {
+            throw new InvoiceApiException(e);
+        }
+    }
+
+    private List<InvoiceItem> extractUsageItemsForSubscription(final UUID subscriptionId, @Nullable final List<Invoice> existingInvoices) {
+
+        if (existingInvoices == null) {
+            return Collections.emptyList();
+        }
+
+        final Iterable usageItems = Iterables.concat(Iterables.transform(existingInvoices, new Function<Invoice, Iterable<InvoiceItem>>() {
+            @Override
+            public Iterable<InvoiceItem> apply(final Invoice input) {
+
+                return Iterables.filter(input.getInvoiceItems(), new Predicate<InvoiceItem>() {
+                    @Override
+                    public boolean apply(final InvoiceItem input) {
+                        return input.getInvoiceItemType() == InvoiceItemType.USAGE && input.getSubscriptionId().equals(subscriptionId);
+                    }
+                });
+            }
+        }));
+        return ImmutableList.<InvoiceItem>copyOf(usageItems);
     }
 
-    private List<InvoiceItem> generateInAdvanceInvoiceItems(final UUID accountId, final UUID invoiceId, @Nullable final BillingEventSet events,
-                                               @Nullable final List<Invoice> existingInvoices, final LocalDate targetDate,
-                                               final Currency targetCurrency) throws InvoiceApiException {
+    private List<InvoiceItem> generateInAdvanceInvoiceItems(final UUID accountId, final UUID invoiceId, final BillingEventSet eventSet,
+                                                            @Nullable final List<Invoice> existingInvoices, final LocalDate targetDate,
+                                                            final Currency targetCurrency) throws InvoiceApiException {
         final AccountItemTree accountItemTree = new AccountItemTree(accountId);
         if (existingInvoices != null) {
             for (final Invoice invoice : existingInvoices) {
                 for (final InvoiceItem item : invoice.getInvoiceItems()) {
                     if (item.getSubscriptionId() == null || // Always include migration invoices, credits, external charges etc.
-                        !events.getSubscriptionIdsWithAutoInvoiceOff()
-                               .contains(item.getSubscriptionId())) { //don't add items with auto_invoice_off tag
+                        !eventSet.getSubscriptionIdsWithAutoInvoiceOff()
+                                 .contains(item.getSubscriptionId())) { //don't add items with auto_invoice_off tag
                         accountItemTree.addExistingItem(item);
                     }
                 }
@@ -106,7 +187,7 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
         }
 
         // Generate list of proposed invoice items based on billing events from junction-- proposed items are ALL items since beginning of time
-        final List<InvoiceItem> proposedItems = generateInAdvanceInvoiceItems(invoiceId, accountId, events, targetDate, targetCurrency);
+        final List<InvoiceItem> proposedItems = generateInAdvanceInvoiceItems(invoiceId, accountId, eventSet, targetDate, targetCurrency);
 
         accountItemTree.mergeWithProposedItems(proposedItems);
         return accountItemTree.getResultingItemList();
@@ -182,7 +263,7 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
         // Handle recurring items
         final BillingPeriod billingPeriod = thisEvent.getBillingPeriod();
         if (billingPeriod != BillingPeriod.NO_BILLING_PERIOD) {
-            final BillingMode billingMode = instantiateBillingMode(thisEvent.getBillingMode());
+            final BillingModeGenerator billingModeGenerator = instantiateBillingMode(thisEvent.getBillingMode());
             final LocalDate startDate = new LocalDate(thisEvent.getEffectiveDate(), thisEvent.getTimeZone());
 
             if (!startDate.isAfter(targetDate)) {
@@ -192,7 +273,7 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
 
                 final List<RecurringInvoiceItemData> itemData;
                 try {
-                    itemData = billingMode.calculateInvoiceItemData(startDate, endDate, targetDate, billCycleDayLocal, billingPeriod);
+                    itemData = billingModeGenerator.generateInvoiceItemData(startDate, endDate, targetDate, billCycleDayLocal, billingPeriod);
                 } catch (InvalidDateSequenceException e) {
                     throw new InvoiceApiException(ErrorCode.INVOICE_INVALID_DATE_SEQUENCE, startDate, endDate, targetDate);
                 }
@@ -228,7 +309,7 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
         return items;
     }
 
-    private BillingMode instantiateBillingMode(final BillingModeType billingMode) {
+    private BillingModeGenerator instantiateBillingMode(final BillingMode billingMode) {
         switch (billingMode) {
             case IN_ADVANCE:
                 return new InAdvanceBillingMode();
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceGenerator.java b/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceGenerator.java
index 014dbcd..e0d6b21 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceGenerator.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceGenerator.java
@@ -23,6 +23,7 @@ import javax.annotation.Nullable;
 
 import org.joda.time.LocalDate;
 
+import org.killbill.billing.callcontext.InternalCallContext;
 import org.killbill.billing.catalog.api.Currency;
 import org.killbill.billing.invoice.api.Invoice;
 import org.killbill.billing.invoice.api.InvoiceApiException;
@@ -31,5 +32,5 @@ import org.killbill.billing.junction.BillingEventSet;
 public interface InvoiceGenerator {
 
     public Invoice generateInvoice(UUID accountId, @Nullable BillingEventSet events, @Nullable List<Invoice> existingInvoices,
-                                   LocalDate targetDate, Currency targetCurrency) throws InvoiceApiException;
+                                   LocalDate targetDate, Currency targetCurrency, final InternalCallContext context) throws InvoiceApiException;
 }
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/InvoiceDispatcher.java b/invoice/src/main/java/org/killbill/billing/invoice/InvoiceDispatcher.java
index 66c6efb..3b74980 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/InvoiceDispatcher.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/InvoiceDispatcher.java
@@ -30,6 +30,10 @@ import javax.annotation.Nullable;
 
 import org.joda.time.DateTime;
 import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.invoice.usage.UsageUtils;
+import org.killbill.billing.junction.BillingEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -82,6 +86,7 @@ import com.google.common.base.Function;
 import com.google.common.base.Joiner;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
 import com.google.inject.Inject;
 
 public class InvoiceDispatcher {
@@ -190,7 +195,7 @@ public class InvoiceDispatcher {
             final Currency targetCurrency = account.getCurrency();
 
             final LocalDate targetDate = dateAndTimeZoneContext != null ? dateAndTimeZoneContext.computeTargetDate(targetDateTime) : null;
-            final Invoice invoice = targetDate != null ? generator.generateInvoice(accountId, billingEvents, invoices, targetDate, targetCurrency) : null;
+            final Invoice invoice = targetDate != null ? generator.generateInvoice(accountId, billingEvents, invoices, targetDate, targetCurrency, context) : null;
             boolean isRealInvoiceWithItems = false;
             if (invoice == null) {
                 log.info("Generated null invoice for accountId {} and targetDate {} (targetDateTime {})", new Object[]{accountId, targetDate, targetDateTime});
@@ -239,7 +244,7 @@ public class InvoiceDispatcher {
                                                                                                                                                          }
                                                                                                                                                      }));
 
-                    final Map<UUID, DateTime> callbackDateTimePerSubscriptions = createNextFutureNotificationDate(invoiceItemModelDaos, dateAndTimeZoneContext);
+                    final Map<UUID, List<DateTime>> callbackDateTimePerSubscriptions = createNextFutureNotificationDate(invoiceItemModelDaos, billingEvents.getUsages(), dateAndTimeZoneContext);
                     invoiceDao.createInvoice(invoiceModelDao, invoiceItemModelDaos, invoicePaymentModelDaos, isRealInvoiceWithItems, callbackDateTimePerSubscriptions, context);
 
                     final List<InvoiceItem> fixedPriceInvoiceItems = invoice.getInvoiceItems(FixedPriceInvoiceItem.class);
@@ -283,26 +288,68 @@ public class InvoiceDispatcher {
         return context.toTenantContext(nonEntityDao.retrieveIdFromObject(context.getTenantRecordId(), ObjectType.TENANT));
     }
 
+
     @VisibleForTesting
-    Map<UUID, DateTime> createNextFutureNotificationDate(final List<InvoiceItemModelDao> invoiceItems, final DateAndTimeZoneContext dateAndTimeZoneContext) {
-        final Map<UUID, DateTime> result = new HashMap<UUID, DateTime>();
+    Map<UUID, List<DateTime>> createNextFutureNotificationDate(final List<InvoiceItemModelDao> invoiceItems, final Map<String, Usage> knownUsages, final DateAndTimeZoneContext dateAndTimeZoneContext) {
+
+        final Map<UUID, List<DateTime>> result = new HashMap<UUID, List<DateTime>>();
+
+        final Map<String, LocalDate> perSubscriptionUsage = new HashMap<String, LocalDate>();
 
         // For each subscription that has a positive (amount) recurring item, create the date
         // at which we should be called back for next invoice.
         //
         for (final InvoiceItemModelDao item : invoiceItems) {
 
-            if (item.getType() == InvoiceItemType.RECURRING) {
-                if ((item.getEndDate() != null) &&
-                    (item.getAmount() == null ||
-                     item.getAmount().compareTo(BigDecimal.ZERO) >= 0)) {
-                    result.put(item.getSubscriptionId(), dateAndTimeZoneContext.computeUTCDateTimeFromLocalDate(item.getEndDate()));
-                }
+            List<DateTime> perSubscriptionCallback = result.get(item.getSubscriptionId());
+            if (perSubscriptionCallback == null && (item.getType() == InvoiceItemType.RECURRING || item.getType() == InvoiceItemType.USAGE)) {
+                perSubscriptionCallback = new ArrayList<DateTime>();
+                result.put(item.getSubscriptionId(), perSubscriptionCallback);
             }
+
+            switch(item.getType()) {
+                case RECURRING:
+                    if ((item.getEndDate() != null) &&
+                        (item.getAmount() == null ||
+                         item.getAmount().compareTo(BigDecimal.ZERO) >= 0)) {
+                        perSubscriptionCallback.add(dateAndTimeZoneContext.computeUTCDateTimeFromLocalDate(item.getEndDate()));
+                    }
+                    break;
+
+                case USAGE:
+                    final String key = item.getSubscriptionId().toString() + ":" + item.getUsageName();
+                    final LocalDate perSubscriptionUsageRecurringDate  = perSubscriptionUsage.get(key);
+                    if (perSubscriptionUsageRecurringDate == null || perSubscriptionUsageRecurringDate.compareTo(item.getEndDate()) < 0) {
+                        perSubscriptionUsage.put(key, item.getEndDate());
+                    }
+                    break;
+
+                default:
+                    // Ignore
+            }
+        }
+
+        for (final String key : perSubscriptionUsage.keySet()) {
+            final String [] parts = key.split(":");
+            final UUID subscriptionId = UUID.fromString(parts[0]);
+
+            final List<DateTime> perSubscriptionCallback = result.get(subscriptionId);
+            final String usageName = parts[1];
+            final LocalDate endDate =  perSubscriptionUsage.get(key);
+
+            final DateTime subscriptionUsageCallbackDate = getNextUsageBillingDate(usageName, endDate, dateAndTimeZoneContext, knownUsages);
+            perSubscriptionCallback.add(subscriptionUsageCallbackDate);
         }
+
         return result;
     }
 
+    private DateTime getNextUsageBillingDate(final String usageName, final LocalDate chargedThroughDate, final DateAndTimeZoneContext dateAndTimeZoneContext, final Map<String, Usage> knownUsages) {
+        final Usage usage = knownUsages.get(usageName);
+        final LocalDate nextCallbackUsageDate = (usage.getBillingMode() == BillingMode.IN_ARREAR) ? chargedThroughDate.plusMonths(usage.getBillingPeriod().getNumberOfMonths()) : chargedThroughDate;
+        return dateAndTimeZoneContext.computeUTCDateTimeFromLocalDate(nextCallbackUsageDate);
+    }
+
     private void setChargedThroughDates(final DateAndTimeZoneContext dateAndTimeZoneContext,
                                         final Collection<InvoiceItem> fixedPriceItems,
                                         final Collection<InvoiceItem> recurringItems,
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/model/AdjInvoiceItem.java b/invoice/src/main/java/org/killbill/billing/invoice/model/AdjInvoiceItem.java
index 5cd34c5..ec14a46 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/model/AdjInvoiceItem.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/model/AdjInvoiceItem.java
@@ -37,7 +37,7 @@ public abstract class AdjInvoiceItem extends InvoiceItemBase {
 
     AdjInvoiceItem(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId,
                    final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final Currency currency, @Nullable final UUID reversingId) {
-        super(id, createdDate, invoiceId, accountId, null, null, null, null, startDate, endDate, amount, currency, reversingId);
+        super(id, createdDate, invoiceId, accountId, null, null, null, null, null, startDate, endDate, amount, currency, reversingId);
     }
 
 
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/model/ExternalChargeInvoiceItem.java b/invoice/src/main/java/org/killbill/billing/invoice/model/ExternalChargeInvoiceItem.java
index 715030f..e2c92c5 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/model/ExternalChargeInvoiceItem.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/model/ExternalChargeInvoiceItem.java
@@ -42,7 +42,7 @@ public class ExternalChargeInvoiceItem extends InvoiceItemBase {
 
     public ExternalChargeInvoiceItem(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId, @Nullable final UUID bundleId,
                                      @Nullable final String description, final LocalDate date, final BigDecimal amount, final Currency currency) {
-        super(id, createdDate, invoiceId, accountId, bundleId, null, description, null, date, null, amount, currency);
+        super(id, createdDate, invoiceId, accountId, bundleId, null, description, null, null, date, null, amount, currency);
     }
 
     @Override
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/model/FixedPriceInvoiceItem.java b/invoice/src/main/java/org/killbill/billing/invoice/model/FixedPriceInvoiceItem.java
index cad9f73..16c2c13 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/model/FixedPriceInvoiceItem.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/model/FixedPriceInvoiceItem.java
@@ -39,7 +39,7 @@ public class FixedPriceInvoiceItem extends InvoiceItemBase {
     public FixedPriceInvoiceItem(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId, final UUID bundleId,
                                  final UUID subscriptionId, final String planName, final String phaseName,
                                  final LocalDate date, final BigDecimal amount, final Currency currency) {
-        super(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, date, null, amount, currency);
+        super(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, null, date, null, amount, currency);
     }
 
     @Override
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/model/InAdvanceBillingMode.java b/invoice/src/main/java/org/killbill/billing/invoice/model/InAdvanceBillingMode.java
index 11d5aa6..31663ef 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/model/InAdvanceBillingMode.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/model/InAdvanceBillingMode.java
@@ -33,14 +33,14 @@ import static org.killbill.billing.invoice.generator.InvoiceDateUtils.calculateN
 import static org.killbill.billing.invoice.generator.InvoiceDateUtils.calculateProRationAfterLastBillingCycleDate;
 import static org.killbill.billing.invoice.generator.InvoiceDateUtils.calculateProRationBeforeFirstBillingPeriod;
 
-public class InAdvanceBillingMode implements BillingMode {
+public class InAdvanceBillingMode implements BillingModeGenerator {
 
     private static final Logger log = LoggerFactory.getLogger(InAdvanceBillingMode.class);
 
     @Override
-    public List<RecurringInvoiceItemData> calculateInvoiceItemData(final LocalDate startDate, @Nullable final LocalDate endDate,
-                                                                   final LocalDate targetDate,
-                                                                   final int billingCycleDayLocal, final BillingPeriod billingPeriod) throws InvalidDateSequenceException {
+    public List<RecurringInvoiceItemData> generateInvoiceItemData(final LocalDate startDate, @Nullable final LocalDate endDate,
+                                                                  final LocalDate targetDate,
+                                                                  final int billingCycleDayLocal, final BillingPeriod billingPeriod) throws InvalidDateSequenceException {
         if (endDate != null && endDate.isBefore(startDate)) {
             throw new InvalidDateSequenceException();
         }
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/model/InvoiceItemBase.java b/invoice/src/main/java/org/killbill/billing/invoice/model/InvoiceItemBase.java
index 175bfec..f874ec0 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/model/InvoiceItemBase.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/model/InvoiceItemBase.java
@@ -51,6 +51,10 @@ public abstract class InvoiceItemBase extends EntityBase implements InvoiceItem 
     /* RepairAdjInvoiceItem */
     protected final UUID linkedItemId;
 
+    /* Usage specific */
+    protected final String usageName;
+
+
     @Override
     public String toString() {
         // Note: we don't use all fields here, as the output would be overwhelming
@@ -72,27 +76,27 @@ public abstract class InvoiceItemBase extends EntityBase implements InvoiceItem 
     */
     // No rate and no reversing item
     public InvoiceItemBase(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId, @Nullable final UUID bundleId,
-                           @Nullable final UUID subscriptionId, @Nullable final String planName, @Nullable final String phaseName,
+                           @Nullable final UUID subscriptionId, @Nullable final String planName, @Nullable final String phaseName, @Nullable final String usageName,
                            final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final Currency currency) {
-        this(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amount, null, currency, null);
+        this(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, null, currency, null);
     }
 
     // With rate but no reversing item
     public InvoiceItemBase(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId, @Nullable final UUID bundleId,
-                           @Nullable final UUID subscriptionId, @Nullable final String planName, @Nullable final String phaseName,
+                           @Nullable final UUID subscriptionId, @Nullable final String planName, @Nullable final String phaseName, @Nullable final String usageName,
                            final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final BigDecimal rate, final Currency currency) {
-        this(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amount, rate, currency, null);
+        this(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, rate, currency, null);
     }
 
     // With  reversing item, no rate
     public InvoiceItemBase(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId, @Nullable final UUID bundleId,
-                           @Nullable final UUID subscriptionId, @Nullable final String planName, @Nullable final String phaseName,
+                           @Nullable final UUID subscriptionId, @Nullable final String planName, @Nullable final String phaseName, @Nullable final String usageName,
                            final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final Currency currency, final UUID reversedItemId) {
-        this(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amount, null, currency, reversedItemId);
+        this(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, null, currency, reversedItemId);
     }
 
     private InvoiceItemBase(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId, @Nullable final UUID bundleId,
-                            @Nullable final UUID subscriptionId, @Nullable final String planName, @Nullable final String phaseName,
+                            @Nullable final UUID subscriptionId, @Nullable final String planName, @Nullable final String phaseName, @Nullable final String usageName,
                             final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final BigDecimal rate, final Currency currency,
                             final UUID reversedItemId) {
         super(id, createdDate, createdDate);
@@ -102,6 +106,7 @@ public abstract class InvoiceItemBase extends EntityBase implements InvoiceItem 
         this.bundleId = bundleId;
         this.planName = planName;
         this.phaseName = phaseName;
+        this.usageName = usageName;
         this.startDate = startDate;
         this.endDate = endDate;
         this.amount = amount;
@@ -170,6 +175,10 @@ public abstract class InvoiceItemBase extends EntityBase implements InvoiceItem 
         return linkedItemId;
     }
 
+    @Override
+    public String getUsageName() {
+        return usageName;
+    }
 
     @Override
     public boolean equals(final Object o) {
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/model/InvoiceItemFactory.java b/invoice/src/main/java/org/killbill/billing/invoice/model/InvoiceItemFactory.java
index 46538b3..01175dd 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/model/InvoiceItemFactory.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/model/InvoiceItemFactory.java
@@ -44,6 +44,7 @@ public class InvoiceItemFactory {
         final UUID subscriptionId = invoiceItemModelDao.getSubscriptionId();
         final String planName = invoiceItemModelDao.getPlanName();
         final String phaseName = invoiceItemModelDao.getPhaseName();
+        final String usageName = invoiceItemModelDao.getUsageName();
         final LocalDate startDate = invoiceItemModelDao.getStartDate();
         final LocalDate endDate = invoiceItemModelDao.getEndDate();
         final BigDecimal amount = invoiceItemModelDao.getAmount();
@@ -78,6 +79,9 @@ public class InvoiceItemFactory {
             case ITEM_ADJ:
                 item = new ItemAdjInvoiceItem(id, createdDate, invoiceId, accountId, startDate, amount, currency, linkedItemId);
                 break;
+            case USAGE:
+                item = new UsageInvoiceItem(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, currency);
+                break;
             default:
                 throw new RuntimeException("Unexpected type of event item " + type);
         }
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/model/RecurringInvoiceItem.java b/invoice/src/main/java/org/killbill/billing/invoice/model/RecurringInvoiceItem.java
index 5194814..b858e8c 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/model/RecurringInvoiceItem.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/model/RecurringInvoiceItem.java
@@ -39,7 +39,7 @@ public class RecurringInvoiceItem extends InvoiceItemBase {
     public RecurringInvoiceItem(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId, final UUID bundleId, final UUID subscriptionId,
                                 final String planName, final String phaseName, final LocalDate startDate, final LocalDate endDate,
                                 final BigDecimal amount, final BigDecimal rate, final Currency currency) {
-        super(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amount, rate, currency);
+        super(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, null, startDate, endDate, amount, rate, currency);
     }
 
     @Override
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/model/UsageInvoiceItem.java b/invoice/src/main/java/org/killbill/billing/invoice/model/UsageInvoiceItem.java
new file mode 100644
index 0000000..d9ca64f
--- /dev/null
+++ b/invoice/src/main/java/org/killbill/billing/invoice/model/UsageInvoiceItem.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.invoice.model;
+
+import java.math.BigDecimal;
+import java.util.UUID;
+
+import javax.annotation.Nullable;
+
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.Currency;
+import org.killbill.billing.invoice.api.InvoiceItemType;
+
+public class UsageInvoiceItem extends InvoiceItemBase {
+
+    public UsageInvoiceItem(final UUID invoiceId, final UUID accountId, @Nullable final UUID bundleId, @Nullable final UUID subscriptionId,
+                            final String planName, final String phaseName, final String usageName,
+                            final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final Currency currency) {
+        this(UUID.randomUUID(), null, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, currency);
+    }
+
+    public UsageInvoiceItem(final UUID id, @Nullable final DateTime createdDate, final UUID invoiceId, final UUID accountId, final UUID bundleId,
+                            final UUID subscriptionId, final String planName, final String phaseName, final String usageName,
+                            final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final Currency currency) {
+        super(id, createdDate, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, currency);
+    }
+
+    @Override
+    public InvoiceItemType getInvoiceItemType() {
+        return InvoiceItemType.USAGE;
+    }
+
+    @Override
+    public String getDescription() {
+        return String.format("%s (usage item)", usageName);
+    }
+
+}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceItemFormatter.java b/invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceItemFormatter.java
index 45b1f53..ef0cca6 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceItemFormatter.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/template/formatters/DefaultInvoiceItemFormatter.java
@@ -135,6 +135,11 @@ public class DefaultInvoiceItemFormatter implements InvoiceItemFormatter {
     }
 
     @Override
+    public String getUsageName() {
+        return Strings.nullToEmpty(translator.getTranslation(locale, item.getUsageName()));
+    }
+
+    @Override
     public UUID getId() {
         return item.getId();
     }
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/tree/AccountItemTree.java b/invoice/src/main/java/org/killbill/billing/invoice/tree/AccountItemTree.java
index 57c6bb1..be44a10 100644
--- a/invoice/src/main/java/org/killbill/billing/invoice/tree/AccountItemTree.java
+++ b/invoice/src/main/java/org/killbill/billing/invoice/tree/AccountItemTree.java
@@ -97,6 +97,7 @@ public class AccountItemTree {
             case CBA_ADJ:
             case CREDIT_ADJ:
             case REFUND_ADJ:
+            case USAGE:
                 return;
 
             case RECURRING:
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/usage/ContiguousIntervalConsumableInArrear.java b/invoice/src/main/java/org/killbill/billing/invoice/usage/ContiguousIntervalConsumableInArrear.java
new file mode 100644
index 0000000..a45875f
--- /dev/null
+++ b/invoice/src/main/java/org/killbill/billing/invoice/usage/ContiguousIntervalConsumableInArrear.java
@@ -0,0 +1,384 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.invoice.usage;
+
+import java.math.BigDecimal;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.CatalogApiException;
+import org.killbill.billing.catalog.api.Currency;
+import org.killbill.billing.catalog.api.TieredBlock;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.invoice.api.InvoiceItem;
+import org.killbill.billing.invoice.api.InvoiceItemType;
+import org.killbill.billing.invoice.generator.BillingIntervalDetail;
+import org.killbill.billing.invoice.model.UsageInvoiceItem;
+import org.killbill.billing.junction.BillingEvent;
+import org.killbill.billing.usage.api.RolledUpUsage;
+import org.killbill.billing.usage.api.UsageUserApi;
+import org.killbill.billing.util.callcontext.TenantContext;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Function;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+import static org.killbill.billing.invoice.usage.UsageUtils.getConsumableInArrearTieredBlocks;
+import static org.killbill.billing.invoice.usage.UsageUtils.getConsumableInArrearUnitTypes;
+
+/**
+ * There is one such class per subscriptionId, matching a given in arrear/consumable usage section and
+ * referenced through a contiguous list of billing events.
+ */
+public class ContiguousIntervalConsumableInArrear {
+
+    private final List<LocalDate> transitionTimes;
+    private final List<BillingEvent> billingEvents;
+
+    private final Usage usage;
+    private final Set<String> unitTypes;
+    private final UsageUserApi usageApi;
+    private final LocalDate targetDate;
+    private final UUID invoiceId;
+    private final TenantContext context;
+    private final AtomicBoolean isBuilt;
+
+    public ContiguousIntervalConsumableInArrear(final Usage usage, final UUID invoiceId, final UsageUserApi usageApi, final LocalDate targetDate, final TenantContext context) {
+        this.usage = usage;
+        this.invoiceId = invoiceId;
+        this.unitTypes = getConsumableInArrearUnitTypes(usage);
+        this.usageApi = usageApi;
+        this.targetDate = targetDate;
+        this.context = context;
+        this.billingEvents = Lists.newLinkedList();
+        this.transitionTimes = Lists.newLinkedList();
+        this.isBuilt = new AtomicBoolean(false);
+    }
+
+    /**
+     * Builds the transitionTimes associated to that usage section. Those are determined based on billing events for when to start and when to stop,
+     * the per usage billingPeriod and finally the targetDate.
+     * <p/>
+     * Those transition dates define the well defined billing granularity periods that should be billed for that specific usage section.
+     *
+     * @param closedInterval whether there was a last billing event referencing the usage section or whether this is ongoing and
+     *                       then targetDate will define the endDate.
+     * @return
+     */
+    public ContiguousIntervalConsumableInArrear build(final boolean closedInterval) {
+
+        Preconditions.checkState(!isBuilt.get());
+        Preconditions.checkState((!closedInterval && billingEvents.size() >= 1) ||
+                                 (closedInterval && billingEvents.size() >= 2));
+
+        final LocalDate startDate = new LocalDate(billingEvents.get(0).getEffectiveDate(), getAccountTimeZone());
+        if (targetDate.isBefore(startDate)) {
+            return this;
+        }
+        final LocalDate endDate = closedInterval ? new LocalDate(billingEvents.get(billingEvents.size() - 1).getEffectiveDate(), getAccountTimeZone()) : targetDate;
+
+        final BillingIntervalDetail bid = new BillingIntervalDetail(startDate, endDate, targetDate, getBCD(), usage.getBillingPeriod());
+
+        int numberOfPeriod = 0;
+        // First billingCycleDate prior startDate
+        LocalDate nextBillCycleDate = bid.getFutureBillingDateFor(numberOfPeriod);
+        transitionTimes.add(startDate);
+        while (!nextBillCycleDate.isAfter(endDate)) {
+            if (nextBillCycleDate.isAfter(startDate)) {
+                transitionTimes.add(nextBillCycleDate);
+            }
+            numberOfPeriod++;
+            nextBillCycleDate = bid.getFutureBillingDateFor(numberOfPeriod);
+        }
+        isBuilt.set(true);
+        return this;
+    }
+
+    /**
+     * Compute the missing usage invoice items based on what should be billed and what has been billed ($ amount comparison).
+     *
+     * @param existingUsage existing on disk usage items for the subscription
+     * @return
+     * @throws CatalogApiException
+     */
+    public List<InvoiceItem> computeMissingItems(final List<InvoiceItem> existingUsage) throws CatalogApiException {
+
+        Preconditions.checkState(isBuilt.get());
+
+        final List<InvoiceItem> result = Lists.newLinkedList();
+
+        final RolledUpUsageForUnitTypesFactory factory = new RolledUpUsageForUnitTypesFactory(getRolledUpUsage(), unitTypes, getAccountTimeZone());
+
+        for (RolledUpUsageForUnitTypes ru : factory.getOrderedRolledUpUsageForUnitTypes()) {
+
+            // Compute total price amount that should be billed for that period of time (and usage section) across unitTypes.
+            BigDecimal toBeBilledUsage = BigDecimal.ZERO;
+            for (final String unitType : unitTypes) {
+                final BigDecimal usageAmountForUnitType = ru.getUsageAmountForUnitType(unitType);
+                final BigDecimal toBeBilledForUnit = computeToBeBilledUsage(usageAmountForUnitType, unitType);
+                toBeBilledUsage = toBeBilledUsage.add(toBeBilledForUnit);
+            }
+            // Retrieves current price amount billed for that period of time (and usage section)
+            final Iterable<InvoiceItem> billedItems = getBilledItems(ru.getStartDate(), ru.getEndDate(), existingUsage);
+            final BigDecimal billedUsage = computeBilledUsage(billedItems);
+
+            // Compare the two and add the missing piece if required. If there has never been any billed item for the period
+            // and if there is nothing to bill for we would also insert a $0 amount
+            if (!billedItems.iterator().hasNext() || billedUsage.compareTo(toBeBilledUsage) < 0) {
+                InvoiceItem item = new UsageInvoiceItem(invoiceId, getAccountId(), getBundleId(), getSubscriptionId(), getPlanName(),
+                                                        getPhaseName(), usage.getName(), ru.getStartDate(), ru.getEndDate(), toBeBilledUsage.subtract(billedUsage), getCurrency());
+                result.add(item);
+            }
+
+        }
+        return result;
+    }
+
+    /**
+     *
+     * @return a list of {@code RolledUpUsage} for each period (between two transitions) * each unitType.
+     */
+    List<RolledUpUsage> getRolledUpUsage() {
+        // There needs to be at least two transitions to define an interval to bill
+        if (transitionTimes.size() <= 1) {
+            return Collections.emptyList();
+        }
+
+        final Iterable<DateTime> transitions = Iterables.transform(transitionTimes, new Function<LocalDate, DateTime>() {
+            @Override
+            public DateTime apply(final LocalDate input) {
+                return localDateToEndOfDayInAccountTimezone(input, getAccountTimeZone());
+            }
+        });
+        return usageApi.getAllUsageForSubscription(getSubscriptionId(), unitTypes, ImmutableList.copyOf(transitions), context);
+    }
+
+    /**
+     *
+     * @param nbUnits  the number of used units for a given period
+     * @param unitType the type of unit
+     * @return  the price amount that should be billed for that period/unitType
+     * @throws CatalogApiException
+     */
+    @VisibleForTesting
+    BigDecimal computeToBeBilledUsage(final BigDecimal nbUnits, final String unitType) throws CatalogApiException {
+
+        Preconditions.checkState(isBuilt.get());
+
+        BigDecimal result = BigDecimal.ZERO;
+        final List<TieredBlock> tieredBlocks = getConsumableInArrearTieredBlocks(usage, unitType);
+        int remainingUnits = nbUnits.intValue();
+        for (TieredBlock tieredBlock : tieredBlocks) {
+
+            final int blockTierSize = tieredBlock.getSize().intValue();
+            final int tmp = remainingUnits / blockTierSize + (remainingUnits % blockTierSize == 0 ? 0 : 1);
+            final int nbUsedTierBlocks;
+            if (tmp > tieredBlock.getMax()) {
+                nbUsedTierBlocks = tieredBlock.getMax().intValue();
+                remainingUnits -= tieredBlock.getMax() * blockTierSize;
+            } else {
+                nbUsedTierBlocks = tmp;
+                remainingUnits = 0;
+            }
+            result = result.add(tieredBlock.getPrice().getPrice(getCurrency()).multiply(new BigDecimal(nbUsedTierBlocks)));
+        }
+        return result;
+    }
+
+    /**
+     *
+     * @param filteredUsageForInterval the list of invoiceItem to consider
+     * @return the price amount that was already billed for that period and usage section (across unitTypes)
+     */
+    @VisibleForTesting
+    BigDecimal computeBilledUsage(final Iterable<InvoiceItem> filteredUsageForInterval) {
+
+        Preconditions.checkState(isBuilt.get());
+        BigDecimal billedAmount = BigDecimal.ZERO;
+        for (InvoiceItem ii : filteredUsageForInterval) {
+            billedAmount = billedAmount.add(ii.getAmount());
+        }
+        // Return the billed $ amount (not the # of units)
+        return billedAmount;
+    }
+
+    Iterable<InvoiceItem> getBilledItems(final LocalDate startDate, final LocalDate endDate, final List<InvoiceItem> existingUsage) {
+
+        Preconditions.checkState(isBuilt.get());
+        return Iterables.filter(existingUsage, new Predicate<InvoiceItem>() {
+            @Override
+            public boolean apply(final InvoiceItem input) {
+                if (input.getInvoiceItemType() != InvoiceItemType.USAGE) {
+                    return false;
+                }
+
+                // STEPH what happens if we discover usage period that overlap (one side or both side) the [startDate, endDate] interval
+                final UsageInvoiceItem usageInput = (UsageInvoiceItem) input;
+                return usageInput.getUsageName().equals(usage.getName()) &&
+                       usageInput.getStartDate().compareTo(startDate) >= 0 &&
+                       usageInput.getEndDate().compareTo(endDate) <= 0;
+            }
+        });
+    }
+
+    @VisibleForTesting
+    List<LocalDate> getTransitionTimes() {
+        return transitionTimes;
+    }
+
+    private static class RolledUpUsageForUnitTypesFactory {
+
+        private final Map<String, RolledUpUsageForUnitTypes> map;
+
+        public RolledUpUsageForUnitTypesFactory(final List<RolledUpUsage> rolledUpUsages, final Set<String> unitTypes, final DateTimeZone accountTimeZone) {
+            map = new HashMap<String, RolledUpUsageForUnitTypes>();
+            for (RolledUpUsage ru : rolledUpUsages) {
+
+                final LocalDate startRolledUpDate = new LocalDate(ru.getStartTime(), accountTimeZone);
+                final LocalDate endRolledUpDate = new LocalDate(ru.getEndTime(), accountTimeZone);
+                final String key = startRolledUpDate + "-" + endRolledUpDate;
+
+                RolledUpUsageForUnitTypes usageForUnitTypes = map.get(key);
+                if (usageForUnitTypes == null) {
+                    usageForUnitTypes = new RolledUpUsageForUnitTypes(startRolledUpDate, endRolledUpDate, unitTypes);
+                    map.put(key, usageForUnitTypes);
+                }
+                usageForUnitTypes.addUsageForUnit(ru.getUnitType(), ru.getAmount());
+            }
+        }
+
+        public List<RolledUpUsageForUnitTypes> getOrderedRolledUpUsageForUnitTypes() {
+            final LinkedList<RolledUpUsageForUnitTypes> result = new LinkedList<RolledUpUsageForUnitTypes>(map.values());
+            Collections.sort(result);
+            return result;
+        }
+    }
+
+    /**
+     * Internal classes to transform RolledUpUsage into a map of usage (types, amount) across each billable interval.
+     */
+    private static class RolledUpUsageForUnitTypes implements Comparable {
+
+        private final LocalDate startDate;
+        private final LocalDate endDate;
+        private final Map<String, BigDecimal> unitAmounts;
+
+        private RolledUpUsageForUnitTypes(final LocalDate startDate, final LocalDate endDate, final Set<String> unitTypes) {
+            this.endDate = endDate;
+            this.startDate = startDate;
+            this.unitAmounts = new HashMap<String, BigDecimal>();
+            for (final String type : unitTypes) {
+                unitAmounts.put(type, BigDecimal.ZERO);
+            }
+        }
+
+        public void addUsageForUnit(final String unitType, BigDecimal amount) {
+            final BigDecimal currentAmount = unitAmounts.get(unitType);
+            unitAmounts.put(unitType, currentAmount.add(amount));
+        }
+
+        public LocalDate getStartDate() {
+            return startDate;
+        }
+
+        public LocalDate getEndDate() {
+            return endDate;
+        }
+
+        public BigDecimal getUsageAmountForUnitType(final String unitType) {
+            return unitAmounts.get(unitType);
+        }
+
+        @Override
+        public int hashCode() {
+            int result = startDate != null ? startDate.hashCode() : 0;
+            result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
+            result = 31 * result + (unitAmounts != null ? unitAmounts.hashCode() : 0);
+            return result;
+        }
+
+        @Override
+        public int compareTo(final Object o) {
+
+            Preconditions.checkArgument(o instanceof RolledUpUsageForUnitTypes);
+            final RolledUpUsageForUnitTypes other = (RolledUpUsageForUnitTypes) o;
+            // We will check later intervals don't overlap.
+            return getEndDate().compareTo(other.getStartDate());
+        }
+    }
+
+    public void addBillingEvent(final BillingEvent event) {
+        Preconditions.checkState(!isBuilt.get());
+        billingEvents.add(event);
+    }
+
+    public Usage getUsage() {
+        return usage;
+    }
+
+    public int getBCD() {
+        return billingEvents.get(0).getBillCycleDayLocal();
+    }
+
+    public UUID getAccountId() {
+        return billingEvents.get(0).getAccount().getId();
+    }
+
+    public UUID getBundleId() {
+        return billingEvents.get(0).getSubscription().getBundleId();
+    }
+
+    public UUID getSubscriptionId() {
+        return billingEvents.get(0).getSubscription().getId();
+    }
+
+    // STEPH_USAGE planName/phaseName,BCD,... might not be correct if we changed plan but Usage section was exactly similar
+    public String getPlanName() {
+        return billingEvents.get(0).getPlan().getName();
+    }
+
+    public String getPhaseName() {
+        return billingEvents.get(0).getPlanPhase().getName();
+    }
+
+    public Currency getCurrency() {
+        return billingEvents.get(0).getCurrency();
+    }
+
+    public DateTimeZone getAccountTimeZone() {
+        return billingEvents.get(0).getTimeZone();
+    }
+
+    static DateTime localDateToEndOfDayInAccountTimezone(final LocalDate input, final DateTimeZone accountTimeZone) {
+        final DateTime dateTimeInAccountTimeZone = new DateTime(input.getYear(), input.getMonthOfYear(), input.getDayOfMonth(), 0, 0, 0, accountTimeZone);
+        return new DateTime(dateTimeInAccountTimeZone, DateTimeZone.UTC);
+    }
+
+}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/usage/SubscriptionConsumableInArrear.java b/invoice/src/main/java/org/killbill/billing/invoice/usage/SubscriptionConsumableInArrear.java
new file mode 100644
index 0000000..6707195
--- /dev/null
+++ b/invoice/src/main/java/org/killbill/billing/invoice/usage/SubscriptionConsumableInArrear.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.invoice.usage;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.annotation.Nullable;
+
+import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.CatalogApiException;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.catalog.api.UsageType;
+import org.killbill.billing.invoice.api.InvoiceItem;
+import org.killbill.billing.junction.BillingEvent;
+import org.killbill.billing.usage.api.UsageUserApi;
+import org.killbill.billing.util.callcontext.TenantContext;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+/**
+ * There is one such class created for each subscriptionId referenced in the billingEvents.
+ */
+public class SubscriptionConsumableInArrear {
+
+    private final UUID invoiceId;
+    private final List<BillingEvent> subscriptionBillingEvents;
+    private final UsageUserApi usageApi;
+    private final LocalDate targetDate;
+    private final TenantContext context;
+
+    public SubscriptionConsumableInArrear(final UUID invoiceId, final List<BillingEvent> subscriptionBillingEvents, final UsageUserApi usageApi, final LocalDate targetDate, final TenantContext context) {
+        this.invoiceId = invoiceId;
+        this.subscriptionBillingEvents = subscriptionBillingEvents;
+        this.usageApi = usageApi;
+        this.targetDate = targetDate;
+        this.context = context;
+    }
+
+    /**
+     * Based on billing events, (@code existingUsage} and targetDate, figure out what remains to be billed.
+     *
+     * @param existingUsage the existing on disk usage items.
+     * @return
+     * @throws CatalogApiException
+     */
+    public List<InvoiceItem> computeMissingUsageInvoiceItems(final List<InvoiceItem> existingUsage) throws CatalogApiException {
+
+        final List<InvoiceItem> result = Lists.newLinkedList();
+        final List<ContiguousIntervalConsumableInArrear> billingEventTransitionTimePeriods = computeInArrearUsageInterval();
+        for (ContiguousIntervalConsumableInArrear usageInterval : billingEventTransitionTimePeriods) {
+            result.addAll(usageInterval.computeMissingItems(existingUsage));
+        }
+        return result;
+    }
+
+    @VisibleForTesting
+    List<ContiguousIntervalConsumableInArrear> computeInArrearUsageInterval() {
+
+        final List<ContiguousIntervalConsumableInArrear> usageIntervals = Lists.newLinkedList();
+
+        final Map<String, ContiguousIntervalConsumableInArrear> inFlightInArrearUsageIntervals = new HashMap<String, ContiguousIntervalConsumableInArrear>();
+
+        final Set<String> allSeenUsage = new HashSet<String>();
+
+        for (BillingEvent event : subscriptionBillingEvents) {
+
+
+            // Extract all in arrear /consumable usage section for that billing event.
+            final List<Usage> usages = findConsumableInArrearUsages(event);
+            allSeenUsage.addAll(Collections2.transform(usages, new Function<Usage, String>() {
+                @Override
+                public String apply(final Usage input) {
+                    return input.getName();
+                }
+            }));
+
+            // All inflight usage interval are candidates to be closed unless we see that current billing event referencing the same usage section.
+            final Set<String> toBeClosed = new HashSet<String>(allSeenUsage);
+
+            for (Usage usage : usages) {
+
+                // Add inflight usage interval if non existent
+                ContiguousIntervalConsumableInArrear existingInterval = inFlightInArrearUsageIntervals.get(usage.getName());
+                if (existingInterval == null) {
+                    existingInterval = new ContiguousIntervalConsumableInArrear(usage, invoiceId, usageApi, targetDate, context);
+                    inFlightInArrearUsageIntervals.put(usage.getName(), existingInterval);
+                }
+                // Add billing event for that usage interval
+                existingInterval.addBillingEvent(event);
+                // Remove usage interval for toBeClosed set
+                toBeClosed.remove(usage.getName());
+            }
+
+            // Build the usage interval that are no longer referenced
+            for (String usageName : toBeClosed) {
+                final ContiguousIntervalConsumableInArrear interval = inFlightInArrearUsageIntervals.remove(usageName);
+                if (interval != null) {
+                    interval.addBillingEvent(event);
+                    usageIntervals.add(interval.build(true));
+                }
+            }
+        }
+        for (String usageName : inFlightInArrearUsageIntervals.keySet()) {
+            usageIntervals.add(inFlightInArrearUsageIntervals.get(usageName).build(false));
+        }
+        inFlightInArrearUsageIntervals.clear();
+        return usageIntervals;
+    }
+
+    List<Usage> findConsumableInArrearUsages(final BillingEvent event) {
+        if (event.getUsages().size() == 0) {
+            return Collections.emptyList();
+        }
+
+        final List<Usage> result = Lists.newArrayList();
+        for (Usage usage : event.getUsages()) {
+            if (usage.getUsageType() != UsageType.CONSUMABLE ||
+                usage.getBillingMode() != BillingMode.IN_ARREAR) {
+                continue;
+            }
+            result.add(usage);
+        }
+        return result;
+    }
+}
diff --git a/invoice/src/main/java/org/killbill/billing/invoice/usage/UsageUtils.java b/invoice/src/main/java/org/killbill/billing/invoice/usage/UsageUtils.java
new file mode 100644
index 0000000..b3a1f5a
--- /dev/null
+++ b/invoice/src/main/java/org/killbill/billing/invoice/usage/UsageUtils.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.invoice.usage;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.annotation.Nullable;
+
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Tier;
+import org.killbill.billing.catalog.api.TieredBlock;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.catalog.api.UsageType;
+import org.killbill.billing.junction.BillingEvent;
+import org.killbill.billing.junction.BillingEventSet;
+
+import com.google.common.base.Function;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+
+public class UsageUtils {
+
+    public static List<TieredBlock> getConsumableInArrearTieredBlocks(final Usage usage, final String unitType) {
+
+        Preconditions.checkArgument(usage.getBillingMode() == BillingMode.IN_ARREAR && usage.getUsageType() == UsageType.CONSUMABLE);
+        Preconditions.checkArgument(usage.getTiers().length > 0);
+
+        final List<TieredBlock> result = Lists.newLinkedList();
+        for (Tier tier : usage.getTiers()) {
+            for (TieredBlock tierBlock : tier.getTieredBlocks()) {
+                if (tierBlock.getUnit().getName().equals(unitType)) {
+                    result.add(tierBlock);
+                }
+            }
+        }
+        return result;
+    }
+
+    public static Set<String> getConsumableInArrearUnitTypes(final Usage usage) {
+
+        Preconditions.checkArgument(usage.getBillingMode() == BillingMode.IN_ARREAR && usage.getUsageType() == UsageType.CONSUMABLE);
+        Preconditions.checkArgument(usage.getTiers().length > 0);
+
+        final Set<String> result = new HashSet<String>();
+        for (Tier tier : usage.getTiers()) {
+            for (TieredBlock tierBlock : tier.getTieredBlocks()) {
+                result.add(tierBlock.getUnit().getName());
+            }
+        }
+        return result;
+    }
+
+}
diff --git a/invoice/src/main/resources/org/killbill/billing/invoice/dao/InvoiceItemSqlDao.sql.stg b/invoice/src/main/resources/org/killbill/billing/invoice/dao/InvoiceItemSqlDao.sql.stg
index f5d7eb2..2ce721a 100644
--- a/invoice/src/main/resources/org/killbill/billing/invoice/dao/InvoiceItemSqlDao.sql.stg
+++ b/invoice/src/main/resources/org/killbill/billing/invoice/dao/InvoiceItemSqlDao.sql.stg
@@ -10,6 +10,7 @@ tableFields(prefix) ::= <<
 , <prefix>subscription_id
 , <prefix>plan_name
 , <prefix>phase_name
+, <prefix>usage_name
 , <prefix>start_date
 , <prefix>end_date
 , <prefix>amount
@@ -28,6 +29,7 @@ tableValues() ::= <<
 , :subscriptionId
 , :planName
 , :phaseName
+, :usageName
 , :startDate
 , :endDate
 , :amount
diff --git a/invoice/src/main/resources/org/killbill/billing/invoice/ddl.sql b/invoice/src/main/resources/org/killbill/billing/invoice/ddl.sql
index beb05f1..b940549 100644
--- a/invoice/src/main/resources/org/killbill/billing/invoice/ddl.sql
+++ b/invoice/src/main/resources/org/killbill/billing/invoice/ddl.sql
@@ -11,6 +11,7 @@ CREATE TABLE invoice_items (
     subscription_id char(36),
     plan_name varchar(50),
     phase_name varchar(50),
+    usage_name varchar(50),
     start_date date NOT NULL,
     end_date date,
     amount numeric(15,9) NOT NULL,
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/dao/MockInvoiceDao.java b/invoice/src/test/java/org/killbill/billing/invoice/dao/MockInvoiceDao.java
index 879fe02..6edc2b3 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/dao/MockInvoiceDao.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/dao/MockInvoiceDao.java
@@ -60,7 +60,7 @@ public class MockInvoiceDao extends MockEntityDaoBase<InvoiceModelDao, Invoice, 
 
     @Override
     public void createInvoice(final InvoiceModelDao invoice, final List<InvoiceItemModelDao> invoiceItems,
-                              final List<InvoicePaymentModelDao> invoicePayments, final boolean isRealInvoice, final Map<UUID, DateTime> callbackDateTimePerSubscriptions, final InternalCallContext context) {
+                              final List<InvoicePaymentModelDao> invoicePayments, final boolean isRealInvoice, final Map<UUID, List<DateTime>> callbackDateTimePerSubscriptions, final InternalCallContext context) {
         synchronized (monitor) {
             invoices.put(invoice.getId(), invoice);
             for (final InvoiceItemModelDao invoiceItemModelDao : invoiceItems) {
@@ -87,6 +87,7 @@ public class MockInvoiceDao extends MockEntityDaoBase<InvoiceModelDao, Invoice, 
         }
     }
 
+
     @Override
     public InvoiceModelDao getByNumber(final Integer number, final InternalTenantContext context) {
         synchronized (monitor) {
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/dao/TestInvoiceDao.java b/invoice/src/test/java/org/killbill/billing/invoice/dao/TestInvoiceDao.java
index 4954538..051ec3d 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/dao/TestInvoiceDao.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/dao/TestInvoiceDao.java
@@ -26,6 +26,7 @@ import java.util.UUID;
 
 import org.joda.time.DateTime;
 import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.mockito.Mockito;
 import org.skife.jdbi.v2.exceptions.TransactionFailedException;
 import org.testng.Assert;
@@ -64,7 +65,6 @@ import org.killbill.billing.invoice.model.RecurringInvoiceItem;
 import org.killbill.billing.invoice.model.RepairAdjInvoiceItem;
 import org.killbill.billing.junction.BillingEvent;
 import org.killbill.billing.junction.BillingEventSet;
-import org.killbill.billing.junction.BillingModeType;
 import org.killbill.billing.subscription.api.SubscriptionBase;
 import org.killbill.billing.subscription.api.SubscriptionBaseTransitionType;
 import org.killbill.billing.util.currency.KillBillMoney;
@@ -1093,13 +1093,13 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
 
         final DateTime effectiveDate1 = new DateTime(2011, 2, 1, 0, 0, 0);
         final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate1, plan1, phase1, null,
-                                                                       recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE,
+                                                                       recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingMode.IN_ADVANCE,
                                                                        "testEvent1", 1L, SubscriptionBaseTransitionType.CREATE);
 
         final BillingEventSet events = new MockBillingEventSet();
         events.add(event1);
 
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, invoiceList, targetDate, Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, invoiceList, targetDate, Currency.USD, context);
         assertEquals(invoice1.getBalance(), KillBillMoney.of(TEN, invoice1.getCurrency()));
         invoiceList.add(invoice1);
 
@@ -1111,13 +1111,13 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
 
         final DateTime effectiveDate2 = new DateTime(2011, 2, 15, 0, 0, 0);
         final BillingEvent event2 = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate2, plan2, phase2, null,
-                                                                       recurringPrice2.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE,
+                                                                       recurringPrice2.getPrice(currency), currency, BillingPeriod.MONTHLY, 1, BillingMode.IN_ADVANCE,
                                                                        "testEvent2", 2L, SubscriptionBaseTransitionType.CREATE);
         events.add(event2);
 
         // second invoice should be for one half (14/28 days) the difference between the rate plans
         // this is a temporary state, since it actually contains an adjusting item that properly belong to invoice 1
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, targetDate, Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, targetDate, Currency.USD, context);
         assertEquals(invoice2.getBalance(), KillBillMoney.of(FIVE, invoice2.getCurrency()));
         invoiceList.add(invoice2);
 
@@ -1143,13 +1143,13 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
         final DateTime effectiveDate = invoiceUtil.buildDate(2011, 1, 1).toDateTimeAtStartOfDay();
 
         final BillingEvent event = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate, plan, phase, null,
-                                                                      recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 15, BillingModeType.IN_ADVANCE,
+                                                                      recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 15, BillingMode.IN_ADVANCE,
                                                                       "testEvent", 1L, SubscriptionBaseTransitionType.CREATE);
         final BillingEventSet events = new MockBillingEventSet();
         events.add(event);
 
         final LocalDate targetDate = invoiceUtil.buildDate(2011, 1, 15);
-        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, targetDate, Currency.USD, context);
 
         // expect one pro-ration item and one full-period item
         assertEquals(invoice.getNumberOfItems(), 2);
@@ -1186,13 +1186,13 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
         final DateTime effectiveDate1 = invoiceUtil.buildDate(2011, 1, 1).toDateTimeAtStartOfDay();
 
         final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate1, plan, phase1, fixedPrice.getPrice(currency),
-                                                                       null, currency, BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE,
+                                                                       null, currency, BillingPeriod.MONTHLY, 1, BillingMode.IN_ADVANCE,
                                                                        "testEvent1", 1L, SubscriptionBaseTransitionType.CREATE);
         final BillingEventSet events = new MockBillingEventSet();
         events.add(event1);
 
         final UUID accountId = account.getId();
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, new LocalDate(effectiveDate1), Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, new LocalDate(effectiveDate1), Currency.USD, context);
         assertNotNull(invoice1);
         assertEquals(invoice1.getNumberOfItems(), 1);
         assertEquals(invoice1.getBalance().compareTo(ZERO), 0);
@@ -1204,11 +1204,11 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
 
         final DateTime effectiveDate2 = effectiveDate1.plusDays(30);
         final BillingEvent event2 = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate2, plan, phase2, null,
-                                                                       recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE,
+                                                                       recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 31, BillingMode.IN_ADVANCE,
                                                                        "testEvent2", 2L, SubscriptionBaseTransitionType.PHASE);
         events.add(event2);
 
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, new LocalDate(effectiveDate2), Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, new LocalDate(effectiveDate2), Currency.USD, context);
         assertNotNull(invoice2);
         assertEquals(invoice2.getNumberOfItems(), 1);
         assertEquals(invoice2.getBalance().compareTo(cheapAmount), 0);
@@ -1218,7 +1218,7 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
         //invoiceUtil.createInvoice(invoice2, invoice2.getTargetDate().getDayOfMonth(), callcontext);
 
         final DateTime effectiveDate3 = effectiveDate2.plusMonths(1);
-        final Invoice invoice3 = generator.generateInvoice(accountId, events, invoiceList, new LocalDate(effectiveDate3), Currency.USD);
+        final Invoice invoice3 = generator.generateInvoice(accountId, events, invoiceList, new LocalDate(effectiveDate3), Currency.USD, context);
         assertNotNull(invoice3);
         assertEquals(invoice3.getNumberOfItems(), 1);
         assertEquals(invoice3.getBalance().compareTo(cheapAmount), 0);
@@ -1229,7 +1229,7 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
     @Test(groups = "slow")
     public void testInvoiceForEmptyEventSet() throws InvoiceApiException {
         final BillingEventSet events = new MockBillingEventSet();
-        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, new LocalDate(), Currency.USD);
+        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, new LocalDate(), Currency.USD, context);
         assertNull(invoice);
     }
 
@@ -1252,18 +1252,18 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
 
         final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate1, plan, phase1,
                                                                        fixedPrice.getPrice(currency), null, currency,
-                                                                       BillingPeriod.MONTHLY, 1, BillingModeType.IN_ADVANCE,
+                                                                       BillingPeriod.MONTHLY, 1, BillingMode.IN_ADVANCE,
                                                                        "testEvent1", 1L, SubscriptionBaseTransitionType.CREATE);
         final BillingEventSet events = new MockBillingEventSet();
         events.add(event1);
 
         final DateTime effectiveDate2 = effectiveDate1.plusDays(30);
         final BillingEvent event2 = invoiceUtil.createMockBillingEvent(null, subscription, effectiveDate2, plan, phase2, null,
-                                                                       recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE,
+                                                                       recurringPrice.getPrice(currency), currency, BillingPeriod.MONTHLY, 31, BillingMode.IN_ADVANCE,
                                                                        "testEvent2", 2L, SubscriptionBaseTransitionType.CHANGE);
         events.add(event2);
 
-        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, new LocalDate(effectiveDate2), Currency.USD);
+        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, new LocalDate(effectiveDate2), Currency.USD, context);
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), 2);
         assertEquals(invoice.getBalance().compareTo(cheapAmount), 0);
@@ -1331,10 +1331,10 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
 
         final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, recuringStartDate.toDateTimeAtStartOfDay(), plan, phase1, null,
                                                                        TEN, Currency.USD,
-                                                                       BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE,
+                                                                       BillingPeriod.MONTHLY, 31, BillingMode.IN_ADVANCE,
                                                                        "new-event", 1L, SubscriptionBaseTransitionType.CREATE);
         events.add(event1);
-        final Invoice newInvoice = generator.generateInvoice(UUID.randomUUID(), events, invoices, targetDate, Currency.USD);
+        final Invoice newInvoice = generator.generateInvoice(UUID.randomUUID(), events, invoices, targetDate, Currency.USD, context);
         invoiceUtil.createInvoice(newInvoice, true, context);
 
         // VERIFY THAT WE STILL HAVE ONLY 2 ITEMS, MEANING THERE WERE NO REPAIR AND NO CBA GENERATED
@@ -1365,11 +1365,11 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
 
         final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, targetDate1, plan, phase1, null,
                                                                        TEN, currency,
-                                                                       BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE,
+                                                                       BillingPeriod.MONTHLY, 31, BillingMode.IN_ADVANCE,
                                                                        "testEvent1", 1L, SubscriptionBaseTransitionType.CHANGE);
         events.add(event1);
 
-        Invoice invoice1 = generator.generateInvoice(UUID.randomUUID(), events, invoices, new LocalDate(targetDate1), Currency.USD);
+        Invoice invoice1 = generator.generateInvoice(UUID.randomUUID(), events, invoices, new LocalDate(targetDate1), Currency.USD, context);
         invoices.add(invoice1);
         invoiceUtil.createInvoice(invoice1, true, context);
         invoice1 = new DefaultInvoice(invoiceDao.getById(invoice1.getId(), context));
@@ -1377,10 +1377,10 @@ public class TestInvoiceDao extends InvoiceTestSuiteWithEmbeddedDB {
 
         final BillingEvent event2 = invoiceUtil.createMockBillingEvent(null, subscription, targetDate1, plan, phase2, null,
                                                                        TWENTY, currency,
-                                                                       BillingPeriod.MONTHLY, 31, BillingModeType.IN_ADVANCE,
+                                                                       BillingPeriod.MONTHLY, 31, BillingMode.IN_ADVANCE,
                                                                        "testEvent2", 2L, SubscriptionBaseTransitionType.CHANGE);
         events.add(event2);
-        Invoice invoice2 = generator.generateInvoice(UUID.randomUUID(), events, invoices, new LocalDate(targetDate2), Currency.USD);
+        Invoice invoice2 = generator.generateInvoice(UUID.randomUUID(), events, invoices, new LocalDate(targetDate2), Currency.USD, context);
         invoiceUtil.createInvoice(invoice2, true, context);
         invoice2 = new DefaultInvoice(invoiceDao.getById(invoice2.getId(), context));
         assertNotNull(invoice2.getInvoiceNumber());
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/generator/TestDefaultInvoiceGenerator.java b/invoice/src/test/java/org/killbill/billing/invoice/generator/TestDefaultInvoiceGenerator.java
index 7229ad8..faa4eb2 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/generator/TestDefaultInvoiceGenerator.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/generator/TestDefaultInvoiceGenerator.java
@@ -28,6 +28,7 @@ import javax.annotation.Nullable;
 
 import org.joda.time.DateTime;
 import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.mockito.Mockito;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -56,7 +57,6 @@ import org.killbill.billing.invoice.model.FixedPriceInvoiceItem;
 import org.killbill.billing.invoice.model.RecurringInvoiceItem;
 import org.killbill.billing.junction.BillingEvent;
 import org.killbill.billing.junction.BillingEventSet;
-import org.killbill.billing.junction.BillingModeType;
 import org.killbill.billing.subscription.api.SubscriptionBase;
 import org.killbill.billing.subscription.api.SubscriptionBaseTransitionType;
 import org.killbill.billing.util.config.InvoiceConfig;
@@ -102,13 +102,13 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
                 return false;
             }
         };
-        this.generator = new DefaultInvoiceGenerator(clock, invoiceConfig);
+        this.generator = new DefaultInvoiceGenerator(clock, null, invoiceConfig, null);
     }
 
     @Test(groups = "fast")
     public void testWithNullEventSetAndNullInvoiceSet() throws InvoiceApiException {
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice = generator.generateInvoice(accountId, null, null, clock.getUTCToday(), Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, null, null, clock.getUTCToday(), Currency.USD, internalCallContext);
         assertNull(invoice);
     }
 
@@ -116,7 +116,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
     public void testWithEmptyEventSet() throws InvoiceApiException {
         final BillingEventSet events = new MockBillingEventSet();
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, clock.getUTCToday(), Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, clock.getUTCToday(), Currency.USD, internalCallContext);
         assertNull(invoice);
     }
 
@@ -136,7 +136,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         final LocalDate targetDate = invoiceUtil.buildDate(2011, 10, 3);
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
 
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), 2);
@@ -174,7 +174,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         // Target date is the next BCD, in local time
         final LocalDate targetDate = invoiceUtil.buildDate(2012, 8, bcdLocal);
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
 
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), 2);
@@ -198,7 +198,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         // Set a target date of today (start date)
         final LocalDate targetDate = startDate;
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
 
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), 1);
@@ -221,7 +221,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         final LocalDate targetDate = invoiceUtil.buildDate(2011, 10, 3);
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
 
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), 2);
@@ -254,7 +254,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         final LocalDate targetDate = invoiceUtil.buildDate(2011, 10, 3);
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
 
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), 2);
@@ -280,7 +280,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         final LocalDate targetDate = invoiceUtil.buildDate(2011, 12, 3);
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
 
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), 4);
@@ -322,7 +322,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         final LocalDate targetDate = invoiceUtil.buildDate(2011, 12, 3);
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
 
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), 4);
@@ -345,12 +345,12 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         LocalDate targetDate = invoiceUtil.buildDate(2011, 12, 1);
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
         final List<Invoice> existingInvoices = new ArrayList<Invoice>();
         existingInvoices.add(invoice1);
 
         targetDate = invoiceUtil.buildDate(2011, 12, 3);
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, existingInvoices, targetDate, Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, existingInvoices, targetDate, Currency.USD, internalCallContext);
 
         assertNull(invoice2);
     }
@@ -523,7 +523,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final LocalDate targetDate = invoiceUtil.buildDate(2011, 1, 1);
         events.add(createBillingEvent(UUID.randomUUID(), UUID.randomUUID(), targetDate, plan, planPhase, 1));
 
-        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, targetDate, Currency.USD, internalCallContext);
 
         assertEquals(invoice.getNumberOfItems(), 1);
     }
@@ -538,7 +538,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         events.add(createBillingEvent(UUID.randomUUID(), UUID.randomUUID(), startDate, plan, planPhase, startDate.getDayOfMonth()));
 
-        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(UUID.randomUUID(), events, null, targetDate, Currency.USD, internalCallContext);
         final RecurringInvoiceItem item = (RecurringInvoiceItem) invoice.getInvoiceItems().get(0);
 
         // end date of the invoice item should be equal to exactly one month later (rounded)
@@ -564,24 +564,24 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final BillingEvent event1 = invoiceUtil.createMockBillingEvent(null, subscription, new DateTime("2012-01-1"),
                                                                        plan, phase1,
                                                                        ZERO, null, Currency.USD, BillingPeriod.NO_BILLING_PERIOD, 1,
-                                                                       BillingModeType.IN_ADVANCE, "Test Event 1", 1L,
+                                                                       BillingMode.IN_ADVANCE, "Test Event 1", 1L,
                                                                        SubscriptionBaseTransitionType.CREATE);
 
         final BillingEvent event2 = invoiceUtil.createMockBillingEvent(null, subscription, changeDate,
                                                                        plan, phase2,
                                                                        ZERO, null, Currency.USD, BillingPeriod.NO_BILLING_PERIOD, 1,
-                                                                       BillingModeType.IN_ADVANCE, "Test Event 2", 2L,
+                                                                       BillingMode.IN_ADVANCE, "Test Event 2", 2L,
                                                                        SubscriptionBaseTransitionType.PHASE);
 
         events.add(event2);
         events.add(event1);
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, new LocalDate("2012-02-01"), Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, new LocalDate("2012-02-01"), Currency.USD, internalCallContext);
         assertNotNull(invoice1);
         assertEquals(invoice1.getNumberOfItems(), 1);
 
         final List<Invoice> invoiceList = new ArrayList<Invoice>();
         invoiceList.add(invoice1);
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, new LocalDate("2012-04-05"), Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, new LocalDate("2012-04-05"), Currency.USD, internalCallContext);
         assertNotNull(invoice2);
         assertEquals(invoice2.getNumberOfItems(), 1);
         final FixedPriceInvoiceItem item = (FixedPriceInvoiceItem) invoice2.getInvoiceItems().get(0);
@@ -606,7 +606,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         events.add(event1);
 
         // ensure both components are invoiced
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, startDate, Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, startDate, Currency.USD, internalCallContext);
         assertNotNull(invoice1);
         assertEquals(invoice1.getNumberOfItems(), 2);
         assertEquals(invoice1.getBalance(), KillBillMoney.of(FIFTEEN, invoice1.getCurrency()));
@@ -618,7 +618,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final LocalDate currentDate = startDate.plusMonths(1);
 
         // ensure that only the recurring price is invoiced
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, currentDate, Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, currentDate, Currency.USD, internalCallContext);
         assertNotNull(invoice2);
         assertEquals(invoice2.getNumberOfItems(), 1);
         assertEquals(invoice2.getBalance(), KillBillMoney.of(FIVE, invoice2.getCurrency()));
@@ -643,7 +643,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         events.add(event1);
 
         // ensure that a single invoice item is generated for the fixed cost
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, startDate, Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, startDate, Currency.USD, internalCallContext);
         assertNotNull(invoice1);
         assertEquals(invoice1.getNumberOfItems(), 1);
         assertEquals(invoice1.getBalance(), KillBillMoney.of(fixedCost1, invoice1.getCurrency()));
@@ -657,7 +657,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         events.add(event2);
 
         // ensure that a single invoice item is generated for the fixed cost
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, phaseChangeDate, Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, phaseChangeDate, Currency.USD, internalCallContext);
         assertNotNull(invoice2);
         assertEquals(invoice2.getNumberOfItems(), 1);
         assertEquals(invoice2.getBalance(), KillBillMoney.of(fixedCost2, invoice2.getCurrency()));
@@ -690,7 +690,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final LocalDate discountPhaseEndDate = trialPhaseEndDate.plusMonths(6);
         events.add(createBillingEvent(subscriptionId, bundleId, discountPhaseEndDate, plan1, phase3, BILL_CYCLE_DAY));
 
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, creationDate, Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, creationDate, Currency.USD, internalCallContext);
         assertNotNull(invoice1);
         assertEquals(invoice1.getNumberOfItems(), 1);
         assertEquals(invoice1.getBalance().compareTo(ZERO), 0);
@@ -698,7 +698,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final List<Invoice> invoiceList = new ArrayList<Invoice>();
         invoiceList.add(invoice1);
 
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, trialPhaseEndDate, Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoiceList, trialPhaseEndDate, Currency.USD, internalCallContext);
         assertNotNull(invoice2);
         assertEquals(invoice2.getNumberOfItems(), 1);
         assertEquals(invoice2.getInvoiceItems().get(0).getStartDate(), trialPhaseEndDate);
@@ -706,7 +706,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         invoiceList.add(invoice2);
         LocalDate targetDate = new LocalDate(trialPhaseEndDate.getYear(), trialPhaseEndDate.getMonthOfYear(), BILL_CYCLE_DAY);
-        final Invoice invoice3 = generator.generateInvoice(accountId, events, invoiceList, targetDate, Currency.USD);
+        final Invoice invoice3 = generator.generateInvoice(accountId, events, invoiceList, targetDate, Currency.USD, internalCallContext);
         assertNotNull(invoice3);
         assertEquals(invoice3.getNumberOfItems(), 1);
         assertEquals(invoice3.getInvoiceItems().get(0).getStartDate(), targetDate);
@@ -714,7 +714,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         invoiceList.add(invoice3);
         targetDate = targetDate.plusMonths(6);
-        final Invoice invoice4 = generator.generateInvoice(accountId, events, invoiceList, targetDate, Currency.USD);
+        final Invoice invoice4 = generator.generateInvoice(accountId, events, invoiceList, targetDate, Currency.USD, internalCallContext);
         assertNotNull(invoice4);
         assertEquals(invoice4.getNumberOfItems(), 7);
     }
@@ -726,7 +726,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final Plan plan1 = new MockPlan();
         final PlanPhase phase1 = createMockMonthlyPlanPhase(null, ZERO, PhaseType.TRIAL);
         events.add(createBillingEvent(UUID.randomUUID(), UUID.randomUUID(), clock.getUTCToday(), plan1, phase1, 1));
-        generator.generateInvoice(UUID.randomUUID(), events, null, targetDate, Currency.USD);
+        generator.generateInvoice(UUID.randomUUID(), events, null, targetDate, Currency.USD, internalCallContext);
     }
 
     private MockPlanPhase createMockMonthlyPlanPhase() {
@@ -763,17 +763,17 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final Currency currency = Currency.USD;
 
         return invoiceUtil.createMockBillingEvent(null, sub, startDate.toDateTimeAtStartOfDay(), plan, planPhase,
-                                                  planPhase.getFixedPrice() == null ? null : planPhase.getFixedPrice().getPrice(currency),
-                                                  planPhase.getRecurringPrice() == null ? null : planPhase.getRecurringPrice().getPrice(currency),
-                                                  currency, planPhase.getBillingPeriod(),
-                                                  billCycleDayLocal, BillingModeType.IN_ADVANCE, "Test", 1L, SubscriptionBaseTransitionType.CREATE);
+                                                  planPhase.getFixed().getPrice() == null ? null : planPhase.getFixed().getPrice().getPrice(currency),
+                                                  planPhase.getRecurring().getRecurringPrice() == null ? null : planPhase.getRecurring().getRecurringPrice().getPrice(currency),
+                                                  currency, planPhase.getRecurring().getBillingPeriod(),
+                                                  billCycleDayLocal, BillingMode.IN_ADVANCE, "Test", 1L, SubscriptionBaseTransitionType.CREATE);
     }
 
     private void testInvoiceGeneration(final UUID accountId, final BillingEventSet events, final List<Invoice> existingInvoices,
                                        final LocalDate targetDate, final int expectedNumberOfItems,
                                        final BigDecimal expectedAmount) throws InvoiceApiException {
         final Currency currency = Currency.USD;
-        final Invoice invoice = generator.generateInvoice(accountId, events, existingInvoices, targetDate, currency);
+        final Invoice invoice = generator.generateInvoice(accountId, events, existingInvoices, targetDate, currency, internalCallContext);
         assertNotNull(invoice);
         assertEquals(invoice.getNumberOfItems(), expectedNumberOfItems);
         existingInvoices.add(invoice);
@@ -800,7 +800,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         events.add(createBillingEvent(baseSubscription.getId(), baseSubscription.getBundleId(), april25, basePlan, basePlanEvergreen, 25));
 
         // generate invoice
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, april25, Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, april25, Currency.USD, internalCallContext);
         assertNotNull(invoice1);
         assertEquals(invoice1.getNumberOfItems(), 1);
         assertEquals(invoice1.getBalance().compareTo(TEN), 0);
@@ -821,7 +821,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         events.add(createBillingEvent(addOnSubscription2.getId(), baseSubscription.getBundleId(), april28, addOn2Plan, addOn2PlanPhaseEvergreen, 25));
 
         // generate invoice
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoices, april28, Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoices, april28, Currency.USD, internalCallContext);
         invoices.add(invoice2);
         assertNotNull(invoice2);
         assertEquals(invoice2.getNumberOfItems(), 2);
@@ -838,7 +838,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         // generate invoice
         final LocalDate may1 = new LocalDate(2012, 5, 1);
-        final Invoice invoice3 = generator.generateInvoice(accountId, newEvents, invoices, may1, Currency.USD);
+        final Invoice invoice3 = generator.generateInvoice(accountId, newEvents, invoices, may1, Currency.USD, internalCallContext);
         assertNotNull(invoice3);
         assertEquals(invoice3.getNumberOfItems(), 3);
         // -4.50 -18 - 10 (to correct the previous 2 invoices) + 4.50 + 13
@@ -861,7 +861,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final BillingEventSet events = new MockBillingEventSet();
         events.add(createBillingEvent(originalSubscription.getId(), originalSubscription.getBundleId(), april25, originalPlan, originalPlanEvergreen, 25));
 
-        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, april25, Currency.USD);
+        final Invoice invoice1 = generator.generateInvoice(accountId, events, null, april25, Currency.USD, internalCallContext);
 
         printDetailInvoice(invoice1);
 
@@ -883,7 +883,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         events.add(createBillingEvent(newSubscription.getId(), originalSubscription.getBundleId(), april25, newPlan, newPlanEvergreen, 25));
 
         // generate a new invoice
-        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoices, april25, Currency.USD);
+        final Invoice invoice2 = generator.generateInvoice(accountId, events, invoices, april25, Currency.USD, internalCallContext);
 
         printDetailInvoice(invoice2);
         assertEquals(invoice2.getNumberOfItems(), 2);
@@ -942,7 +942,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         final LocalDate targetDate = invoiceUtil.buildDate(2011, 10, 3);
         final UUID accountId = UUID.randomUUID();
-        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
+        final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD, internalCallContext);
 
         assertNull(invoice);
     }
@@ -970,7 +970,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         eventSet.add(createBillingEvent(subscriptionId2, bundleId, startDate, plan2, plan2phase1, 1));
 
         // generate the first invoice
-        final Invoice invoice1 = generator.generateInvoice(accountId, eventSet, invoices, startDate, currency);
+        final Invoice invoice1 = generator.generateInvoice(accountId, eventSet, invoices, startDate, currency, internalCallContext);
         assertNotNull(invoice1);
         assertTrue(invoice1.getBalance().compareTo(FIFTEEN.add(TWELVE)) == 0);
         invoices.add(invoice1);
@@ -981,7 +981,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         eventSet.addSubscriptionWithAutoInvoiceOff(subscriptionId1);
 
         final LocalDate targetDate2 = startDate.plusMonths(1);
-        final Invoice invoice2 = generator.generateInvoice(accountId, eventSet, invoices, targetDate2, currency);
+        final Invoice invoice2 = generator.generateInvoice(accountId, eventSet, invoices, targetDate2, currency, internalCallContext);
         assertNotNull(invoice2);
         assertTrue(invoice2.getBalance().compareTo(TWELVE) == 0);
         invoices.add(invoice2);
@@ -989,7 +989,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final LocalDate targetDate3 = targetDate2.plusMonths(1);
         eventSet.clearSubscriptionsWithAutoInvoiceOff();
         eventSet.add(subscription1creation);
-        final Invoice invoice3 = generator.generateInvoice(accountId, eventSet, invoices, targetDate3, currency);
+        final Invoice invoice3 = generator.generateInvoice(accountId, eventSet, invoices, targetDate3, currency, internalCallContext);
         assertNotNull(invoice3);
         assertTrue(invoice3.getBalance().compareTo(FIFTEEN.multiply(TWO).add(TWELVE)) == 0);
     }
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/glue/TestInvoiceModule.java b/invoice/src/test/java/org/killbill/billing/invoice/glue/TestInvoiceModule.java
index e601ca8..e3a2942 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/glue/TestInvoiceModule.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/glue/TestInvoiceModule.java
@@ -16,22 +16,21 @@
 
 package org.killbill.billing.invoice.glue;
 
-import org.killbill.billing.util.glue.MemoryGlobalLockerModule;
-import org.mockito.Mockito;
-import org.skife.config.ConfigSource;
-
 import org.killbill.billing.catalog.glue.CatalogModule;
 import org.killbill.billing.invoice.TestInvoiceHelper;
+import org.killbill.billing.junction.BillingInternalApi;
+import org.killbill.billing.subscription.api.SubscriptionBaseInternalApi;
+import org.killbill.billing.usage.glue.UsageModule;
 import org.killbill.billing.util.email.EmailModule;
 import org.killbill.billing.util.email.templates.TemplateModule;
 import org.killbill.billing.util.glue.CacheModule;
 import org.killbill.billing.util.glue.CallContextModule;
 import org.killbill.billing.util.glue.CustomFieldModule;
+import org.killbill.billing.util.glue.MemoryGlobalLockerModule;
 import org.killbill.billing.util.glue.NotificationQueueModule;
 import org.killbill.billing.util.glue.TagStoreModule;
-import org.killbill.billing.junction.BillingInternalApi;
-import org.killbill.billing.subscription.api.SubscriptionBaseInternalApi;
-
+import org.mockito.Mockito;
+import org.skife.config.ConfigSource;
 
 public class TestInvoiceModule extends DefaultInvoiceModule {
 
@@ -58,7 +57,7 @@ public class TestInvoiceModule extends DefaultInvoiceModule {
         install(new NotificationQueueModule(configSource));
         install(new TagStoreModule());
         install(new CustomFieldModule());
-
+        install(new UsageModule(configSource));
         installExternalApis();
 
         bind(TestInvoiceHelper.class).asEagerSingleton();
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/InvoiceTestSuiteNoDB.java b/invoice/src/test/java/org/killbill/billing/invoice/InvoiceTestSuiteNoDB.java
index c7b34cf..dc72ae4 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/InvoiceTestSuiteNoDB.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/InvoiceTestSuiteNoDB.java
@@ -32,6 +32,7 @@ import org.killbill.billing.invoice.generator.InvoiceGenerator;
 import org.killbill.billing.invoice.glue.TestInvoiceModuleNoDB;
 import org.killbill.billing.junction.BillingInternalApi;
 import org.killbill.billing.subscription.api.SubscriptionBaseInternalApi;
+import org.killbill.billing.usage.api.UsageUserApi;
 import org.killbill.billing.util.KillbillConfigSource;
 import org.killbill.billing.util.api.TagUserApi;
 import org.killbill.billing.util.cache.CacheControllerDispatcher;
@@ -90,6 +91,8 @@ public abstract class InvoiceTestSuiteNoDB extends GuicyKillbillTestSuiteNoDB {
     protected TestInvoiceHelper invoiceUtil;
     @Inject
     protected CurrencyConversionApi currencyConversionApi;
+    @Inject
+    protected UsageUserApi usageUserApi;
 
     @Override
     protected KillbillConfigSource getConfigSource() throws IOException, URISyntaxException {
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/MockBillingEventSet.java b/invoice/src/test/java/org/killbill/billing/invoice/MockBillingEventSet.java
index 615acc0..d93cf5b 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/MockBillingEventSet.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/MockBillingEventSet.java
@@ -17,10 +17,14 @@
 package org.killbill.billing.invoice;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.TreeSet;
 import java.util.UUID;
 
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Usage;
 import org.killbill.billing.junction.BillingEvent;
 import org.killbill.billing.junction.BillingEventSet;
 
@@ -41,10 +45,20 @@ public class MockBillingEventSet extends TreeSet<BillingEvent> implements Billin
     }
 
     @Override
+    public BillingMode getRecurringBillingMode() {
+        return BillingMode.IN_ADVANCE;
+    }
+
+    @Override
     public List<UUID> getSubscriptionIdsWithAutoInvoiceOff() {
         return subscriptionIdsWithAutoInvoiceOff;
     }
 
+    @Override
+    public Map<String, Usage> getUsages() {
+        return Collections.emptyMap();
+    }
+
     public void setAccountInvoiceOff(final boolean isAccountInvoiceOff) {
         this.isAccountInvoiceOff = isAccountInvoiceOff;
     }
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/model/TestInAdvanceBillingMode.java b/invoice/src/test/java/org/killbill/billing/invoice/model/TestInAdvanceBillingMode.java
index 693537d..c5c35b9 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/model/TestInAdvanceBillingMode.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/model/TestInAdvanceBillingMode.java
@@ -150,7 +150,7 @@ public class TestInAdvanceBillingMode extends InvoiceTestSuiteNoDB {
                                     final LinkedHashMap<LocalDate, LocalDate> expectedDates) throws InvalidDateSequenceException {
         final InAdvanceBillingMode billingMode = new InAdvanceBillingMode();
 
-        final List<RecurringInvoiceItemData> invoiceItems = billingMode.calculateInvoiceItemData(startDate, endDate, targetDate, billingCycleDayLocal, billingPeriod);
+        final List<RecurringInvoiceItemData> invoiceItems = billingMode.generateInvoiceItemData(startDate, endDate, targetDate, billingCycleDayLocal, billingPeriod);
 
         int i = 0;
         for (final LocalDate periodStartDate : expectedDates.keySet()) {
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/TestInvoiceDispatcher.java b/invoice/src/test/java/org/killbill/billing/invoice/TestInvoiceDispatcher.java
index 42d69de..a306cab 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/TestInvoiceDispatcher.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/TestInvoiceDispatcher.java
@@ -25,6 +25,7 @@ import java.util.UUID;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.mockito.Mockito;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
@@ -52,7 +53,6 @@ import org.killbill.billing.subscription.api.SubscriptionBase;
 import org.killbill.billing.subscription.api.SubscriptionBaseTransitionType;
 import org.killbill.billing.callcontext.InternalCallContext;
 import org.killbill.billing.junction.BillingEventSet;
-import org.killbill.billing.junction.BillingModeType;
 import org.killbill.billing.util.timezone.DateAndTimeZoneContext;
 
 public class TestInvoiceDispatcher extends InvoiceTestSuiteWithEmbeddedDB {
@@ -82,7 +82,7 @@ public class TestInvoiceDispatcher extends InvoiceTestSuiteWithEmbeddedDB {
         final BigDecimal fixedPrice = null;
         events.add(invoiceUtil.createMockBillingEvent(account, subscription, effectiveDate, plan, planPhase,
                                                       fixedPrice, BigDecimal.ONE, currency, BillingPeriod.MONTHLY, 1,
-                                                      BillingModeType.IN_ADVANCE, "", 1L, SubscriptionBaseTransitionType.CREATE));
+                                                      BillingMode.IN_ADVANCE, "", 1L, SubscriptionBaseTransitionType.CREATE));
 
         Mockito.when(billingApi.getBillingEventsForAccountAndUpdateAccountBCD(Mockito.<UUID>any(), Mockito.<InternalCallContext>any())).thenReturn(events);
 
@@ -122,23 +122,23 @@ public class TestInvoiceDispatcher extends InvoiceTestSuiteWithEmbeddedDB {
         final MockPlan bicycleTrialEvergreen1USD = MockPlan.createBicycleTrialEvergreen1USD();
         events.add(invoiceUtil.createMockBillingEvent(account, subscription, new DateTime("2012-05-01T00:03:42.000Z"), bicycleTrialEvergreen1USD,
                                                       new MockPlanPhase(bicycleTrialEvergreen1USD, PhaseType.TRIAL), BigDecimal.ZERO, null, account.getCurrency(), BillingPeriod.NO_BILLING_PERIOD,
-                                                      31, BillingModeType.IN_ADVANCE, "CREATE", 1L, SubscriptionBaseTransitionType.CREATE));
+                                                      31, BillingMode.IN_ADVANCE, "CREATE", 1L, SubscriptionBaseTransitionType.CREATE));
         // Phase change to evergreen
         events.add(invoiceUtil.createMockBillingEvent(account, subscription, new DateTime("2012-05-31T00:03:42.000Z"), bicycleTrialEvergreen1USD,
                                                       new MockPlanPhase(bicycleTrialEvergreen1USD, PhaseType.EVERGREEN), null, new BigDecimal("249.95"), account.getCurrency(), BillingPeriod.MONTHLY,
-                                                      31, BillingModeType.IN_ADVANCE, "PHASE", 2L, SubscriptionBaseTransitionType.PHASE));
+                                                      31, BillingMode.IN_ADVANCE, "PHASE", 2L, SubscriptionBaseTransitionType.PHASE));
         // Overdue period
         events.add(invoiceUtil.createMockBillingEvent(account, subscription, new DateTime("2012-07-15T00:00:00.000Z"), bicycleTrialEvergreen1USD,
                                                       new MockPlanPhase(bicycleTrialEvergreen1USD, PhaseType.EVERGREEN), null, null, account.getCurrency(), BillingPeriod.NO_BILLING_PERIOD,
-                                                      31, BillingModeType.IN_ADVANCE, "", 0L, SubscriptionBaseTransitionType.START_BILLING_DISABLED));
+                                                      31, BillingMode.IN_ADVANCE, "", 0L, SubscriptionBaseTransitionType.START_BILLING_DISABLED));
         events.add(invoiceUtil.createMockBillingEvent(account, subscription, new DateTime("2012-07-25T00:00:00.000Z"), bicycleTrialEvergreen1USD,
                                                       new MockPlanPhase(bicycleTrialEvergreen1USD, PhaseType.EVERGREEN), null, new BigDecimal("249.95"), account.getCurrency(), BillingPeriod.MONTHLY,
-                                                      31, BillingModeType.IN_ADVANCE, "", 1L, SubscriptionBaseTransitionType.END_BILLING_DISABLED));
+                                                      31, BillingMode.IN_ADVANCE, "", 1L, SubscriptionBaseTransitionType.END_BILLING_DISABLED));
         // Upgrade after the overdue period
         final MockPlan jetTrialEvergreen1000USD = MockPlan.createJetTrialEvergreen1000USD();
         events.add(invoiceUtil.createMockBillingEvent(account, subscription, new DateTime("2012-07-25T00:04:00.000Z"), jetTrialEvergreen1000USD,
                                                       new MockPlanPhase(jetTrialEvergreen1000USD, PhaseType.EVERGREEN), null, new BigDecimal("1000"), account.getCurrency(), BillingPeriod.MONTHLY,
-                                                      31, BillingModeType.IN_ADVANCE, "CHANGE", 3L, SubscriptionBaseTransitionType.CHANGE));
+                                                      31, BillingMode.IN_ADVANCE, "CHANGE", 3L, SubscriptionBaseTransitionType.CHANGE));
 
         Mockito.when(billingApi.getBillingEventsForAccountAndUpdateAccountBCD(Mockito.<UUID>any(), Mockito.<InternalCallContext>any())).thenReturn(events);
         final InvoiceNotifier invoiceNotifier = new NullInvoiceNotifier();
@@ -199,24 +199,23 @@ public class TestInvoiceDispatcher extends InvoiceTestSuiteWithEmbeddedDB {
         final DateAndTimeZoneContext dateAndTimeZoneContext = new DateAndTimeZoneContext(clock.getUTCNow(), DateTimeZone.forID("Pacific/Pitcairn"), clock);
 
         final InvoiceItemModelDao item = new InvoiceItemModelDao(UUID.randomUUID(), clock.getUTCNow(), InvoiceItemType.RECURRING, UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID(),
-                                                                 "planName", "phaseName", startDate, endDate, new BigDecimal("23.9"), new BigDecimal("23.9"), Currency.EUR, null);
+                                                                 "planName", "phaseName", null, startDate, endDate, new BigDecimal("23.9"), new BigDecimal("23.9"), Currency.EUR, null);
 
         final InvoiceNotifier invoiceNotifier = new NullInvoiceNotifier();
         final InvoiceDispatcher dispatcher = new InvoiceDispatcher(generator, accountApi, billingApi, subscriptionApi, invoiceDao,
                                                                    nonEntityDao, invoiceNotifier, locker, busService.getBus(),
                                                                    clock);
 
-        final DateTime expectedBefore = clock.getUTCNow();
-        final Map<UUID, DateTime> result = dispatcher.createNextFutureNotificationDate(Collections.singletonList(item), dateAndTimeZoneContext);
-        final DateTime expectedAfter = clock.getUTCNow();
+        final Map<UUID, List<DateTime>> result = dispatcher.createNextFutureNotificationDate(Collections.singletonList(item), null, dateAndTimeZoneContext);
 
         Assert.assertEquals(result.size(), 1);
 
-        final DateTime receivedDate = result.get(item.getSubscriptionId());
+        final List<DateTime> receivedDates = result.get(item.getSubscriptionId());
+        Assert.assertEquals(receivedDates.size(), 1);
 
-        final LocalDate receivedTargetDate = new LocalDate(receivedDate, DateTimeZone.forID("Pacific/Pitcairn"));
+        final LocalDate receivedTargetDate = new LocalDate(receivedDates.get(0), DateTimeZone.forID("Pacific/Pitcairn"));
         Assert.assertEquals(receivedTargetDate, endDate);
 
-        Assert.assertTrue(receivedDate.compareTo(new DateTime(2012, 11, 27, 1, 12, 23, DateTimeZone.UTC)) <= 0);
+        Assert.assertTrue(receivedDates.get(0).compareTo(new DateTime(2012, 11, 27, 1, 12, 23, DateTimeZone.UTC)) <= 0);
     }
 }
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/TestInvoiceHelper.java b/invoice/src/test/java/org/killbill/billing/invoice/TestInvoiceHelper.java
index 376f5c8..22e1331 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/TestInvoiceHelper.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/TestInvoiceHelper.java
@@ -17,6 +17,7 @@
 package org.killbill.billing.invoice;
 
 import java.math.BigDecimal;
+import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
 
@@ -26,6 +27,8 @@ import javax.inject.Inject;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Usage;
 import org.mockito.Mockito;
 import org.skife.jdbi.v2.IDBI;
 import org.testng.Assert;
@@ -63,7 +66,6 @@ import org.killbill.billing.invoice.notification.NullInvoiceNotifier;
 import org.killbill.billing.junction.BillingEvent;
 import org.killbill.billing.junction.BillingEventSet;
 import org.killbill.billing.junction.BillingInternalApi;
-import org.killbill.billing.junction.BillingModeType;
 import org.killbill.billing.mock.MockAccountBuilder;
 import org.killbill.billing.subscription.api.SubscriptionBase;
 import org.killbill.billing.subscription.api.SubscriptionBaseInternalApi;
@@ -182,7 +184,7 @@ public class TestInvoiceHelper {
         final BigDecimal fixedPrice = null;
         events.add(createMockBillingEvent(account, subscription, effectiveDate, plan, planPhase,
                                           fixedPrice, BigDecimal.ONE, currency, BillingPeriod.MONTHLY, 1,
-                                          BillingModeType.IN_ADVANCE, "", 1L, SubscriptionBaseTransitionType.CREATE));
+                                          BillingMode.IN_ADVANCE, "", 1L, SubscriptionBaseTransitionType.CREATE));
 
         Mockito.when(billingApi.getBillingEventsForAccountAndUpdateAccountBCD(Mockito.<UUID>any(), Mockito.<InternalCallContext>any())).thenReturn(events);
 
@@ -271,7 +273,7 @@ public class TestInvoiceHelper {
                                                                                                                                          }));
 
         // The test does not use the invoice callback notifier hence the empty map
-        invoiceDao.createInvoice(invoiceModelDao, invoiceItemModelDaos, invoicePaymentModelDaos, isRealInvoiceWithItems, ImmutableMap.<UUID, DateTime>of(), internalCallContext);
+        invoiceDao.createInvoice(invoiceModelDao, invoiceItemModelDaos, invoicePaymentModelDaos, isRealInvoiceWithItems, ImmutableMap.<UUID, List<DateTime>>of(), internalCallContext);
     }
 
     public void createPayment(final InvoicePayment invoicePayment, final InternalCallContext internalCallContext) {
@@ -308,13 +310,17 @@ public class TestInvoiceHelper {
                                                @Nullable final BigDecimal fixedPrice, @Nullable final BigDecimal recurringPrice,
                                                final Currency currency, final BillingPeriod billingPeriod,
                                                final int billCycleDayLocal,
-                                               final BillingModeType billingModeType, final String description,
+                                               final BillingMode billingMode, final String description,
                                                final long totalOrdering,
                                                final SubscriptionBaseTransitionType type) {
+
+        final Account mockAccount = Mockito.mock(Account.class);
+        Mockito.when(mockAccount.getTimeZone()).thenReturn(DateTimeZone.UTC);
+        final Account accountOrMockAcount = account != null ? account : mockAccount;
         return new BillingEvent() {
             @Override
             public Account getAccount() {
-                return account;
+                return accountOrMockAcount;
             }
 
             @Override
@@ -348,8 +354,8 @@ public class TestInvoiceHelper {
             }
 
             @Override
-            public BillingModeType getBillingMode() {
-                return billingModeType;
+            public BillingMode getBillingMode() {
+                return billingMode;
             }
 
             @Override
@@ -388,6 +394,11 @@ public class TestInvoiceHelper {
             }
 
             @Override
+            public List<Usage> getUsages() {
+                return Collections.emptyList();
+            }
+
+            @Override
             public int compareTo(final BillingEvent e1) {
                 if (!getSubscription().getId().equals(e1.getSubscription().getId())) { // First order by subscription
                     return getSubscription().getId().compareTo(e1.getSubscription().getId());
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/tests/inAdvance/ProRationInAdvanceTestBase.java b/invoice/src/test/java/org/killbill/billing/invoice/tests/inAdvance/ProRationInAdvanceTestBase.java
index f3913fc..6fd8e15 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/tests/inAdvance/ProRationInAdvanceTestBase.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/tests/inAdvance/ProRationInAdvanceTestBase.java
@@ -16,14 +16,14 @@
 
 package org.killbill.billing.invoice.tests.inAdvance;
 
-import org.killbill.billing.invoice.model.BillingMode;
+import org.killbill.billing.invoice.model.BillingModeGenerator;
 import org.killbill.billing.invoice.model.InAdvanceBillingMode;
 import org.killbill.billing.invoice.tests.ProRationTestBase;
 
 public abstract class ProRationInAdvanceTestBase extends ProRationTestBase {
 
     @Override
-    protected BillingMode getBillingMode() {
+    protected BillingModeGenerator getBillingMode() {
         return new InAdvanceBillingMode();
     }
 }
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/tests/inAdvance/TestValidationProRation.java b/invoice/src/test/java/org/killbill/billing/invoice/tests/inAdvance/TestValidationProRation.java
index c647604..741316e 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/tests/inAdvance/TestValidationProRation.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/tests/inAdvance/TestValidationProRation.java
@@ -16,15 +16,11 @@
 
 package org.killbill.billing.invoice.tests.inAdvance;
 
-import static org.killbill.billing.invoice.TestInvoiceHelper.*;
-
-import java.math.BigDecimal;
-
 import org.joda.time.LocalDate;
+import org.killbill.billing.invoice.model.BillingModeGenerator;
 import org.testng.annotations.Test;
 
 import org.killbill.billing.catalog.api.BillingPeriod;
-import org.killbill.billing.invoice.model.BillingMode;
 import org.killbill.billing.invoice.model.InAdvanceBillingMode;
 import org.killbill.billing.invoice.model.InvalidDateSequenceException;
 import org.killbill.billing.invoice.tests.ProRationTestBase;
@@ -39,7 +35,7 @@ public class TestValidationProRation extends ProRationTestBase {
     }
 
     @Override
-    protected BillingMode getBillingMode() {
+    protected BillingModeGenerator getBillingMode() {
         return new InAdvanceBillingMode();
     }
 
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/tests/InvoiceTestUtils.java b/invoice/src/test/java/org/killbill/billing/invoice/tests/InvoiceTestUtils.java
index b21e3e9..811dacc 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/tests/InvoiceTestUtils.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/tests/InvoiceTestUtils.java
@@ -87,7 +87,7 @@ public class InvoiceTestUtils {
         }
         Mockito.when(invoice.getInvoiceItems()).thenReturn(invoiceItems);
 
-        invoiceDao.createInvoice(new InvoiceModelDao(invoice), invoiceModelItems, ImmutableList.<InvoicePaymentModelDao>of(), true, ImmutableMap.<UUID, DateTime>of(), internalCallContext);
+        invoiceDao.createInvoice(new InvoiceModelDao(invoice), invoiceModelItems, ImmutableList.<InvoicePaymentModelDao>of(), true, ImmutableMap.<UUID, List<DateTime>>of(), internalCallContext);
 
         return invoice;
     }
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/tests/ProRationTestBase.java b/invoice/src/test/java/org/killbill/billing/invoice/tests/ProRationTestBase.java
index 2785e4f..4ce38af 100644
--- a/invoice/src/test/java/org/killbill/billing/invoice/tests/ProRationTestBase.java
+++ b/invoice/src/test/java/org/killbill/billing/invoice/tests/ProRationTestBase.java
@@ -25,7 +25,7 @@ import org.joda.time.LocalDate;
 
 import org.killbill.billing.catalog.api.BillingPeriod;
 import org.killbill.billing.invoice.InvoiceTestSuiteNoDB;
-import org.killbill.billing.invoice.model.BillingMode;
+import org.killbill.billing.invoice.model.BillingModeGenerator;
 import org.killbill.billing.invoice.model.InvalidDateSequenceException;
 import org.killbill.billing.invoice.model.RecurringInvoiceItemData;
 
@@ -34,7 +34,7 @@ import static org.testng.Assert.fail;
 
 public abstract class ProRationTestBase extends InvoiceTestSuiteNoDB {
 
-    protected abstract BillingMode getBillingMode();
+    protected abstract BillingModeGenerator getBillingMode();
 
     protected abstract BillingPeriod getBillingPeriod();
 
@@ -65,7 +65,7 @@ public abstract class ProRationTestBase extends InvoiceTestSuiteNoDB {
     }
 
     protected BigDecimal calculateNumberOfBillingCycles(final LocalDate startDate, final LocalDate endDate, final LocalDate targetDate, final int billingCycleDay) throws InvalidDateSequenceException {
-        final List<RecurringInvoiceItemData> items = getBillingMode().calculateInvoiceItemData(startDate, endDate, targetDate, billingCycleDay, getBillingPeriod());
+        final List<RecurringInvoiceItemData> items = getBillingMode().generateInvoiceItemData(startDate, endDate, targetDate, billingCycleDay, getBillingPeriod());
 
         BigDecimal numberOfBillingCycles = ZERO;
         for (final RecurringInvoiceItemData item : items) {
@@ -76,7 +76,7 @@ public abstract class ProRationTestBase extends InvoiceTestSuiteNoDB {
     }
 
     protected BigDecimal calculateNumberOfBillingCycles(final LocalDate startDate, final LocalDate targetDate, final int billingCycleDay) throws InvalidDateSequenceException {
-        final List<RecurringInvoiceItemData> items = getBillingMode().calculateInvoiceItemData(startDate, null, targetDate, billingCycleDay, getBillingPeriod());
+        final List<RecurringInvoiceItemData> items = getBillingMode().generateInvoiceItemData(startDate, null, targetDate, billingCycleDay, getBillingPeriod());
 
         BigDecimal numberOfBillingCycles = ZERO;
         for (final RecurringInvoiceItemData item : items) {
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/usage/TestContiguousIntervalConsumableInArrear.java b/invoice/src/test/java/org/killbill/billing/invoice/usage/TestContiguousIntervalConsumableInArrear.java
new file mode 100644
index 0000000..a78dcbc
--- /dev/null
+++ b/invoice/src/test/java/org/killbill/billing/invoice/usage/TestContiguousIntervalConsumableInArrear.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.invoice.usage;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.joda.time.DateTimeZone;
+import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.DefaultTier;
+import org.killbill.billing.catalog.DefaultTieredBlock;
+import org.killbill.billing.catalog.DefaultUsage;
+import org.killbill.billing.catalog.api.CatalogApiException;
+import org.killbill.billing.catalog.api.Currency;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.invoice.api.InvoiceItem;
+import org.killbill.billing.invoice.model.FixedPriceInvoiceItem;
+import org.killbill.billing.invoice.model.UsageInvoiceItem;
+import org.killbill.billing.junction.BillingEvent;
+import org.killbill.billing.usage.api.RolledUpUsage;
+import org.killbill.billing.usage.api.user.DefaultRolledUpUsage;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.beust.jcommander.internal.Lists;
+import com.google.common.collect.ImmutableList;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+public class TestContiguousIntervalConsumableInArrear extends TestUsageInArrearBase {
+
+    @BeforeClass(groups = "fast")
+    protected void beforeClass() throws Exception {
+        super.beforeClass();
+    }
+
+    @BeforeMethod(groups = "fast")
+    public void beforeMethod() {
+        super.beforeMethod();
+        // Default invoice test binding;
+        this.mockUsageUserApi = usageUserApi;
+    }
+
+    @Test(groups = "fast")
+    public void testComputeToBeBilledUsage() {
+
+        final LocalDate startDate = new LocalDate(2014, 03, 20);
+        final LocalDate endDate = new LocalDate(2014, 04, 20);
+
+        final DefaultTieredBlock block = createDefaultTieredBlock("unit", 100, 1000, BigDecimal.ONE);
+        final DefaultTier tier = createDefaultTier(block);
+        final DefaultUsage usage = createDefaultUsage(usageName, tier);
+
+        final LocalDate targetDate = startDate.plusDays(1);
+        final ContiguousIntervalConsumableInArrear intervalConsumableInArrear = createContiguousIntervalConsumableInArrear(usage, targetDate, false,
+                                                                                                                           createMockBillingEvent(targetDate.toDateTimeAtStartOfDay(DateTimeZone.UTC),
+                                                                                                                                                  Collections.<Usage>emptyList()));
+
+        final List<InvoiceItem> existingUsage = Lists.newArrayList();
+        final UsageInvoiceItem ii1 = new UsageInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usage.getName(), startDate, endDate, BigDecimal.TEN, currency);
+        existingUsage.add(ii1);
+        final UsageInvoiceItem ii2 = new UsageInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usage.getName(), startDate, endDate, BigDecimal.TEN, currency);
+        existingUsage.add(ii2);
+
+        // Will be ignored as is starts one day earlier.
+        final UsageInvoiceItem ii3 = new UsageInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usage.getName(), startDate.minusDays(1), endDate, BigDecimal.TEN, currency);
+        existingUsage.add(ii3);
+
+        // Will be ignored as it is for a different udsage section
+        final UsageInvoiceItem ii4 = new UsageInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, "other", startDate, endDate, BigDecimal.TEN, currency);
+        existingUsage.add(ii4);
+
+        // Will be ignored because non usage item
+        final FixedPriceInvoiceItem ii5 = new FixedPriceInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, BigDecimal.TEN, currency);
+        existingUsage.add(ii5);
+
+        final BigDecimal result = intervalConsumableInArrear.computeBilledUsage(intervalConsumableInArrear.getBilledItems(startDate, endDate, existingUsage));
+        assertEquals(result, BigDecimal.TEN.add(BigDecimal.TEN));
+    }
+
+    @Test(groups = "fast")
+    public void testComputeBilledUsage() throws CatalogApiException {
+
+        final DefaultTieredBlock block1 = createDefaultTieredBlock("unit", 100, 10, BigDecimal.ONE);
+        final DefaultTier tier1 = createDefaultTier(block1);
+
+        final DefaultTieredBlock block2 = createDefaultTieredBlock("unit", 1000, 100, BigDecimal.ONE);
+        final DefaultTier tier2 = createDefaultTier(block2);
+        final DefaultUsage usage = createDefaultUsage(usageName, tier1, tier2);
+
+        final LocalDate targetDate = new LocalDate(2014, 03, 20);
+        final ContiguousIntervalConsumableInArrear intervalConsumableInArrear = createContiguousIntervalConsumableInArrear(usage, targetDate, false,
+                                                                                                                           createMockBillingEvent(targetDate.toDateTimeAtStartOfDay(DateTimeZone.UTC),
+                                                                                                                           Collections.<Usage>emptyList()));
+
+        final BigDecimal result = intervalConsumableInArrear.computeToBeBilledUsage(new BigDecimal("5325"), "unit");
+
+        // 5000 = 1000 (tier1) + 4325 (tier2) => 10 + 5 = 15
+        assertEquals(result, new BigDecimal("15"));
+    }
+
+    @Test(groups = "fast")
+    public void testComputeMissingItems() throws CatalogApiException {
+
+        final LocalDate startDate = new LocalDate(2014, 03, 20);
+        final LocalDate firstBCDDate = new LocalDate(2014, 04, 15);
+        final LocalDate endDate = new LocalDate(2014, 05, 15);
+
+        // 2 items for startDate - firstBCDDate
+        final RolledUpUsage usage1 = new DefaultRolledUpUsage(subscriptionId, "unit", startDate.toDateTimeAtStartOfDay(DateTimeZone.UTC), firstBCDDate.toDateTimeAtStartOfDay(DateTimeZone.UTC), new BigDecimal("130"));
+        final RolledUpUsage usage2 = new DefaultRolledUpUsage(subscriptionId, "unit", startDate.toDateTimeAtStartOfDay(DateTimeZone.UTC), firstBCDDate.toDateTimeAtStartOfDay(DateTimeZone.UTC), new BigDecimal("271"));
+
+        // 1 items for firstBCDDate - endDate
+        final RolledUpUsage usage3 = new DefaultRolledUpUsage(subscriptionId, "unit", firstBCDDate.toDateTimeAtStartOfDay(DateTimeZone.UTC), endDate.toDateTimeAtStartOfDay(DateTimeZone.UTC), new BigDecimal("199"));
+
+        final List<RolledUpUsage> usages = ImmutableList.<RolledUpUsage>builder().add(usage1).add(usage2).add(usage3).build();
+        this.mockUsageUserApi = createMockUsageUserApi(usages);
+
+        final DefaultTieredBlock block = createDefaultTieredBlock("unit", 100, 10, BigDecimal.ONE);
+        final DefaultTier tier = createDefaultTier(block);
+        final DefaultUsage usage = createDefaultUsage(usageName, tier);
+
+        final LocalDate targetDate = endDate;
+
+        final BillingEvent event1 = createMockBillingEvent(startDate.toDateTimeAtStartOfDay(DateTimeZone.UTC), Collections.<Usage>emptyList());
+        final BillingEvent event2 = createMockBillingEvent(endDate.toDateTimeAtStartOfDay(DateTimeZone.UTC), Collections.<Usage>emptyList());
+
+        final ContiguousIntervalConsumableInArrear intervalConsumableInArrear = createContiguousIntervalConsumableInArrear(usage, targetDate, true, event1, event2);
+
+        final List<InvoiceItem> invoiceItems = new ArrayList<InvoiceItem>();
+        InvoiceItem ii1 = new UsageInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usage.getName(), startDate, firstBCDDate, BigDecimal.ONE, currency);
+        invoiceItems.add(ii1);
+
+        InvoiceItem ii2 = new UsageInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usage.getName(), firstBCDDate, endDate, BigDecimal.ONE, currency);
+        invoiceItems.add(ii2);
+
+        final List<InvoiceItem> result = intervalConsumableInArrear.computeMissingItems(invoiceItems);
+        assertEquals(result.size(), 2);
+        // Invoiced for 1 BTC and used 130 + 271 = 401 => 5 blocks => 5 BTC so remaining piece should be 4 BTC
+        assertTrue(result.get(0).getAmount().compareTo(new BigDecimal("4.0")) == 0);
+        assertEquals(result.get(0).getCurrency(), Currency.BTC);
+        assertEquals(result.get(0).getAccountId(), accountId);
+        assertEquals(result.get(0).getBundleId(), bundleId);
+        assertEquals(result.get(0).getSubscriptionId(), subscriptionId);
+        assertEquals(result.get(0).getPlanName(), planName);
+        assertEquals(result.get(0).getPhaseName(), phaseName);
+        assertEquals(result.get(0).getUsageName(), usage.getName());
+        assertTrue(result.get(0).getStartDate().compareTo(startDate) == 0);
+        assertTrue(result.get(0).getEndDate().compareTo(firstBCDDate) == 0);
+
+        // Invoiced for 1 BTC and used 199  => 2 blocks => 2 BTC so remaining piece should be 1 BTC
+        assertTrue(result.get(1).getAmount().compareTo(new BigDecimal("1.0")) == 0);
+        assertEquals(result.get(1).getCurrency(), Currency.BTC);
+        assertEquals(result.get(1).getAccountId(), accountId);
+        assertEquals(result.get(1).getBundleId(), bundleId);
+        assertEquals(result.get(1).getSubscriptionId(), subscriptionId);
+        assertEquals(result.get(1).getPlanName(), planName);
+        assertEquals(result.get(1).getPhaseName(), phaseName);
+        assertEquals(result.get(1).getUsageName(), usage.getName());
+        assertTrue(result.get(1).getStartDate().compareTo(firstBCDDate) == 0);
+        assertTrue(result.get(1).getEndDate().compareTo(endDate) == 0);
+
+    }
+
+}
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/usage/TestSubscriptionConsumableInArrear.java b/invoice/src/test/java/org/killbill/billing/invoice/usage/TestSubscriptionConsumableInArrear.java
new file mode 100644
index 0000000..06df090
--- /dev/null
+++ b/invoice/src/test/java/org/killbill/billing/invoice/usage/TestSubscriptionConsumableInArrear.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.invoice.usage;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.DefaultTier;
+import org.killbill.billing.catalog.DefaultTieredBlock;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.junction.BillingEvent;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.beust.jcommander.internal.Lists;
+import com.google.common.collect.ImmutableList;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+public class TestSubscriptionConsumableInArrear extends TestUsageInArrearBase {
+
+    @BeforeClass(groups = "fast")
+    protected void beforeClass() throws Exception {
+        super.beforeClass();
+    }
+
+    @Test(groups = "fast")
+    public void testComputeInArrearUsageInterval() {
+
+        final List<BillingEvent> billingEvents = Lists.newArrayList();
+
+        final String usageName1 = "erw";
+        final DefaultTieredBlock block1 = createDefaultTieredBlock("unit", 100, 10, BigDecimal.ONE);
+        final DefaultTier tier1 = createDefaultTier(block1);
+        final Usage usage1 = createDefaultUsage(usageName1, tier1);
+
+        final String usageName2 = "hghg";
+        final DefaultTieredBlock block2 = createDefaultTieredBlock("unit", 100, 10, BigDecimal.ONE);
+        final DefaultTier tier2 = createDefaultTier(block2);
+        final Usage usage2 = createDefaultUsage(usageName2, tier2);
+
+        final DateTime dt1 = new DateTime(2013, 3, 23, 4, 34, 59, DateTimeZone.UTC);
+        final BillingEvent evt1 = createMockBillingEvent(dt1, ImmutableList.<Usage>builder().add(usage1).add(usage2).build());
+        billingEvents.add(evt1);
+
+        final DateTime dt2 = new DateTime(2013, 4, 23, 4, 34, 59, DateTimeZone.UTC);
+        final BillingEvent evt2 = createMockBillingEvent(dt2, ImmutableList.<Usage>builder().add(usage1).build());
+        billingEvents.add(evt2);
+
+        final DateTime dt3 = new DateTime(2013, 5, 23, 4, 34, 59, DateTimeZone.UTC);
+        final BillingEvent evt3 = createMockBillingEvent(dt3, ImmutableList.<Usage>builder().add(usage1).add(usage2).build());
+        billingEvents.add(evt3);
+
+        LocalDate targetDate = new LocalDate(2013, 6, 23);
+
+        final SubscriptionConsumableInArrear foo = new SubscriptionConsumableInArrear(invoiceId, billingEvents, usageUserApi, targetDate, callContext);
+        final List<ContiguousIntervalConsumableInArrear> result = foo.computeInArrearUsageInterval();
+        assertEquals(result.size(), 3);
+
+        assertEquals(result.get(0).getUsage().getName(), usageName2);
+        assertEquals(result.get(0).getTransitionTimes().size(), 2);
+        assertTrue(result.get(0).getTransitionTimes().get(0).compareTo(new LocalDate(2013, 3, 23)) == 0);
+        assertTrue(result.get(0).getTransitionTimes().get(1).compareTo(new LocalDate(2013, 4, 15)) == 0);
+
+        assertEquals(result.get(1).getUsage().getName(), usageName1);
+        assertEquals(result.get(1).getTransitionTimes().size(), 4);
+        assertTrue(result.get(1).getTransitionTimes().get(0).compareTo(new LocalDate(2013, 3, 23)) == 0);
+        assertTrue(result.get(1).getTransitionTimes().get(1).compareTo(new LocalDate(2013, 4, 15)) == 0);
+        assertTrue(result.get(1).getTransitionTimes().get(2).compareTo(new LocalDate(2013, 5, 15)) == 0);
+        assertTrue(result.get(1).getTransitionTimes().get(3).compareTo(new LocalDate(2013, 6, 15)) == 0);
+
+        assertEquals(result.get(2).getUsage().getName(), usageName2);
+        assertEquals(result.get(2).getTransitionTimes().size(), 2);
+        assertTrue(result.get(2).getTransitionTimes().get(0).compareTo(new LocalDate(2013, 5, 23)) == 0);
+        assertTrue(result.get(2).getTransitionTimes().get(1).compareTo(new LocalDate(2013, 6, 15)) == 0);
+
+    }
+
+}
diff --git a/invoice/src/test/java/org/killbill/billing/invoice/usage/TestUsageInArrearBase.java b/invoice/src/test/java/org/killbill/billing/invoice/usage/TestUsageInArrearBase.java
new file mode 100644
index 0000000..994fac4
--- /dev/null
+++ b/invoice/src/test/java/org/killbill/billing/invoice/usage/TestUsageInArrearBase.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.invoice.usage;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.LocalDate;
+import org.killbill.billing.account.api.Account;
+import org.killbill.billing.catalog.DefaultInternationalPrice;
+import org.killbill.billing.catalog.DefaultPrice;
+import org.killbill.billing.catalog.DefaultTier;
+import org.killbill.billing.catalog.DefaultTieredBlock;
+import org.killbill.billing.catalog.DefaultUnit;
+import org.killbill.billing.catalog.DefaultUsage;
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.Currency;
+import org.killbill.billing.catalog.api.Plan;
+import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.catalog.api.UsageType;
+import org.killbill.billing.invoice.InvoiceTestSuiteNoDB;
+import org.killbill.billing.junction.BillingEvent;
+import org.killbill.billing.subscription.api.SubscriptionBase;
+import org.killbill.billing.usage.api.RolledUpUsage;
+import org.killbill.billing.usage.api.UsageUserApi;
+import org.killbill.billing.util.callcontext.TenantContext;
+import org.mockito.Mockito;
+import org.testng.annotations.BeforeClass;
+
+public abstract class TestUsageInArrearBase extends InvoiceTestSuiteNoDB {
+
+    protected int BCD;
+    protected UUID accountId;
+    protected UUID bundleId;
+    protected UUID subscriptionId;
+    protected UUID invoiceId;
+    protected String planName;
+    protected String phaseName;
+    protected Currency currency;
+    protected String usageName;
+
+    protected UsageUserApi mockUsageUserApi;
+
+
+    @BeforeClass(groups = "fast")
+    protected void beforeClass() throws Exception {
+        super.beforeClass();
+        BCD = 15;
+        usageName = "foo";
+        accountId = UUID.randomUUID();
+        bundleId = UUID.randomUUID();
+        subscriptionId = UUID.randomUUID();
+        invoiceId = UUID.randomUUID();
+        planName = "planName";
+        phaseName = "phaseName";
+        currency = Currency.BTC;
+    }
+
+    protected UsageUserApi createMockUsageUserApi(final List<RolledUpUsage> returnValue) {
+        final UsageUserApi result = Mockito.mock(UsageUserApi.class);
+        Mockito.when(result.getAllUsageForSubscription(Mockito.<UUID>any(), Mockito.<Set<String>>any(), Mockito.<List<DateTime>>any(), Mockito.<TenantContext>any())).thenReturn(returnValue);
+        return result;
+    }
+
+    protected ContiguousIntervalConsumableInArrear createContiguousIntervalConsumableInArrear(final DefaultUsage usage, final LocalDate targetDate, final boolean closedInterval, final BillingEvent... events) {
+        final ContiguousIntervalConsumableInArrear intervalConsumableInArrear = new ContiguousIntervalConsumableInArrear(usage, invoiceId, mockUsageUserApi, targetDate, callContext);
+        for (BillingEvent event : events) {
+            intervalConsumableInArrear.addBillingEvent(event);
+        }
+        intervalConsumableInArrear.build(closedInterval);
+        return intervalConsumableInArrear;
+    }
+
+    protected DefaultUsage createDefaultUsage(final String usageName, final DefaultTier... tiers) {
+        final DefaultUsage usage = new DefaultUsage();
+        usage.setName(usageName);
+        usage.setBillingMode(BillingMode.IN_ARREAR);
+        usage.setUsageType(UsageType.CONSUMABLE);
+        usage.setBillingPeriod(BillingPeriod.MONTHLY);
+        usage.setTiers(tiers);
+        return usage;
+    }
+
+    protected DefaultTier createDefaultTier(final DefaultTieredBlock... blocks) {
+        DefaultTier tier = new DefaultTier();
+        tier.setBlocks(blocks);
+        return tier;
+    }
+
+    protected DefaultTieredBlock createDefaultTieredBlock(final String unit, final int size, final int max, final BigDecimal btcPrice) {
+        final DefaultTieredBlock block = new DefaultTieredBlock();
+        block.setUnit(new DefaultUnit().setName(unit));
+        block.setSize(new Double(size));
+
+        final DefaultPrice[] prices = new DefaultPrice[1];
+        prices[0] = new DefaultPrice();
+        prices[0].setCurrency(Currency.BTC).setValue(btcPrice);
+
+        block.setPrice(new DefaultInternationalPrice().setPrices(prices));
+        block.setMax(new Double(max));
+        return block;
+    }
+
+    protected BillingEvent createMockBillingEvent(DateTime effectiveDate, final List<Usage> usages) {
+        final BillingEvent result = Mockito.mock(BillingEvent.class);
+        Mockito.when(result.getCurrency()).thenReturn(Currency.BTC);
+        Mockito.when(result.getBillCycleDayLocal()).thenReturn(BCD);
+        Mockito.when(result.getTimeZone()).thenReturn(DateTimeZone.UTC);
+        Mockito.when(result.getEffectiveDate()).thenReturn(effectiveDate);
+
+        final Account account = Mockito.mock(Account.class);
+        Mockito.when(account.getId()).thenReturn(accountId);
+        Mockito.when(result.getAccount()).thenReturn(account);
+
+        final SubscriptionBase subscription = Mockito.mock(SubscriptionBase.class);
+        Mockito.when(subscription.getId()).thenReturn(subscriptionId);
+        Mockito.when(subscription.getBundleId()).thenReturn(bundleId);
+        Mockito.when(result.getSubscription()).thenReturn(subscription);
+
+        final Plan plan = Mockito.mock(Plan.class);
+        Mockito.when(plan.getName()).thenReturn(planName);
+        Mockito.when(result.getPlan()).thenReturn(plan);
+
+        final PlanPhase phase = Mockito.mock(PlanPhase.class);
+        Mockito.when(phase.getName()).thenReturn(phaseName);
+        Mockito.when(result.getPlanPhase()).thenReturn(phase);
+
+        Mockito.when(result.getUsages()).thenReturn(usages);
+        return result;
+    }
+
+}
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/CatalogJsonSimple.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/CatalogJsonSimple.java
index 3e63851..31bf18d 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/CatalogJsonSimple.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/CatalogJsonSimple.java
@@ -70,8 +70,8 @@ public class CatalogJsonSimple {
             final List<PhaseJson> phases = new LinkedList<PhaseJson>();
             for (final PlanPhase phase : plan.getAllPhases()) {
                 final List<PriceJson> prices = new LinkedList<PriceJson>();
-                if (phase.getRecurringPrice() != null) {
-                    for (final Price price : phase.getRecurringPrice().getPrices()) {
+                if (phase.getRecurring() != null && phase.getRecurring().getRecurringPrice() != null) {
+                    for (final Price price : phase.getRecurring().getRecurringPrice().getPrices()) {
                         prices.add(new PriceJson(price));
                     }
                 }
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/InvoiceItemJson.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/InvoiceItemJson.java
index ab424d5..e280dc8 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/InvoiceItemJson.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/InvoiceItemJson.java
@@ -40,6 +40,7 @@ public class InvoiceItemJson extends JsonBase {
     private final String subscriptionId;
     private final String planName;
     private final String phaseName;
+    private final String usageName;
     private final String itemType;
     private final String description;
     private final LocalDate startDate;
@@ -56,6 +57,7 @@ public class InvoiceItemJson extends JsonBase {
                            @JsonProperty("subscriptionId") final String subscriptionId,
                            @JsonProperty("planName") final String planName,
                            @JsonProperty("phaseName") final String phaseName,
+                           @JsonProperty("usageName") final String usageName,
                            @JsonProperty("itemType") final String itemType,
                            @JsonProperty("description") final String description,
                            @JsonProperty("startDate") final LocalDate startDate,
@@ -72,6 +74,7 @@ public class InvoiceItemJson extends JsonBase {
         this.subscriptionId = subscriptionId;
         this.planName = planName;
         this.phaseName = phaseName;
+        this.usageName = usageName;
         this.itemType = itemType;
         this.description = description;
         this.startDate = startDate;
@@ -83,7 +86,7 @@ public class InvoiceItemJson extends JsonBase {
     public InvoiceItemJson(final InvoiceItem item, @Nullable final List<AuditLog> auditLogs) {
         this(toString(item.getId()), toString(item.getInvoiceId()), toString(item.getLinkedItemId()),
              toString(item.getAccountId()), toString(item.getBundleId()), toString(item.getSubscriptionId()),
-             item.getPlanName(), item.getPhaseName(), item.getInvoiceItemType().toString(),
+             item.getPlanName(), item.getPhaseName(), item.getUsageName(), item.getInvoiceItemType().toString(),
              item.getDescription(), item.getStartDate(), item.getEndDate(),
              item.getAmount(), item.getCurrency(), toAuditLogJson(auditLogs));
     }
@@ -124,6 +127,10 @@ public class InvoiceItemJson extends JsonBase {
         return phaseName;
     }
 
+    public String getUsageName() {
+        return usageName;
+    }
+
     public String getItemType() {
         return itemType;
     }
@@ -160,6 +167,7 @@ public class InvoiceItemJson extends JsonBase {
         sb.append(", subscriptionId='").append(subscriptionId).append('\'');
         sb.append(", planName='").append(planName).append('\'');
         sb.append(", phaseName='").append(phaseName).append('\'');
+        sb.append(", usageName='").append(usageName).append('\'');
         sb.append(", description='").append(description).append('\'');
         sb.append(", startDate=").append(startDate);
         sb.append(", endDate=").append(endDate);
@@ -212,6 +220,9 @@ public class InvoiceItemJson extends JsonBase {
         if (phaseName != null ? !phaseName.equals(that.phaseName) : that.phaseName != null) {
             return false;
         }
+        if (usageName != null ? !usageName.equals(that.usageName) : that.usageName != null) {
+            return false;
+        }
         if (planName != null ? !planName.equals(that.planName) : that.planName != null) {
             return false;
         }
@@ -236,6 +247,7 @@ public class InvoiceItemJson extends JsonBase {
         result = 31 * result + (subscriptionId != null ? subscriptionId.hashCode() : 0);
         result = 31 * result + (planName != null ? planName.hashCode() : 0);
         result = 31 * result + (phaseName != null ? phaseName.hashCode() : 0);
+        result = 31 * result + (usageName != null ? usageName.hashCode() : 0);
         result = 31 * result + (description != null ? description.hashCode() : 0);
         result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
         result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/PlanDetailJson.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/PlanDetailJson.java
index 1492b13..5f41dfb 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/PlanDetailJson.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/PlanDetailJson.java
@@ -66,11 +66,14 @@ public class PlanDetailJson {
         } else {
             this.productName = plan.getProduct() == null ? null : plan.getProduct().getName();
             this.planName = plan.getName();
-            this.billingPeriod = plan.getBillingPeriod();
-            if (plan.getFinalPhase() == null || plan.getFinalPhase().getRecurringPrice() == null || plan.getFinalPhase().getRecurringPrice().getPrices() == null) {
+            this.billingPeriod = plan.getRecurringBillingPeriod();
+            if (plan.getFinalPhase() == null ||
+                plan.getFinalPhase().getRecurring() == null ||
+                plan.getFinalPhase().getRecurring().getRecurringPrice() == null ||
+                plan.getFinalPhase().getRecurring().getRecurringPrice().getPrices() == null) {
                 this.finalPhasePrice = ImmutableList.<PriceJson>of();
             } else {
-                this.finalPhasePrice = Lists.transform(ImmutableList.<Price>copyOf(plan.getFinalPhase().getRecurringPrice().getPrices()),
+                this.finalPhasePrice = Lists.transform(ImmutableList.<Price>copyOf(plan.getFinalPhase().getRecurring().getRecurringPrice().getPrices()),
                                                        new Function<Price, PriceJson>() {
                                                            @Override
                                                            public PriceJson apply(final Price price) {
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/SubscriptionJson.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/SubscriptionJson.java
index 6959a1a..ffecd4a 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/SubscriptionJson.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/SubscriptionJson.java
@@ -318,7 +318,7 @@ public class SubscriptionJson extends JsonBase {
         this.startDate = subscription.getEffectiveStartDate();
         this.productName = subscription.getLastActiveProduct().getName();
         this.productCategory = subscription.getLastActiveProductCategory().name();
-        this.billingPeriod = subscription.getLastActivePlan().getBillingPeriod().toString();
+        this.billingPeriod = subscription.getLastActivePlan().getRecurringBillingPeriod().toString();
         this.priceList = subscription.getLastActivePriceList().getName();
         this.cancelledDate = subscription.getEffectiveEndDate();
         this.chargedThroughDate = subscription.getChargedThroughDate();
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/UsageJson.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/UsageJson.java
new file mode 100644
index 0000000..47661e6
--- /dev/null
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/json/UsageJson.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * The Billing Project licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.jaxrs.json;
+
+import java.math.BigDecimal;
+
+import org.joda.time.DateTime;
+import org.killbill.billing.usage.api.RolledUpUsage;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class UsageJson {
+
+    private final String subscriptionId;
+    private final String unitType;
+    private final DateTime startTime;
+    private final DateTime endTime;
+    private final BigDecimal amount;
+
+    @JsonCreator
+    public UsageJson(@JsonProperty("subscriptionId") final String subscriptionId,
+                     @JsonProperty("unitType") final String unitType,
+                     @JsonProperty("startTime") final DateTime startTime,
+                     @JsonProperty("endTime") final DateTime endTime,
+                     @JsonProperty("amount") final BigDecimal amount) {
+        this.subscriptionId = subscriptionId;
+        this.unitType = unitType;
+        this.startTime = startTime;
+        this.endTime = endTime;
+        this.amount = amount;
+    }
+
+    public UsageJson(final RolledUpUsage usage) {
+        this(usage.getSubscriptionId().toString(), usage.getUnitType(), usage.getStartTime(), usage.getEndTime(), usage.getAmount());
+    }
+
+    public String getSubscriptionId() {
+        return subscriptionId;
+    }
+
+    public String getUnitType() {
+        return unitType;
+    }
+
+    public DateTime getStartTime() {
+        return startTime;
+    }
+
+    public DateTime getEndTime() {
+        return endTime;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    @Override
+    public boolean equals(final Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof UsageJson)) {
+            return false;
+        }
+
+        final UsageJson usageJson = (UsageJson) o;
+
+        if (amount != null ? !amount.equals(usageJson.amount) : usageJson.amount != null) {
+            return false;
+        }
+        if (endTime != null ? !endTime.equals(usageJson.endTime) : usageJson.endTime != null) {
+            return false;
+        }
+        if (startTime != null ? !startTime.equals(usageJson.startTime) : usageJson.startTime != null) {
+            return false;
+        }
+        if (subscriptionId != null ? !subscriptionId.equals(usageJson.subscriptionId) : usageJson.subscriptionId != null) {
+            return false;
+        }
+        if (unitType != null ? !unitType.equals(usageJson.unitType) : usageJson.unitType != null) {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = subscriptionId != null ? subscriptionId.hashCode() : 0;
+        result = 31 * result + (unitType != null ? unitType.hashCode() : 0);
+        result = 31 * result + (startTime != null ? startTime.hashCode() : 0);
+        result = 31 * result + (endTime != null ? endTime.hashCode() : 0);
+        result = 31 * result + (amount != null ? amount.hashCode() : 0);
+        return result;
+    }
+}
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/JaxrsResource.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/JaxrsResource.java
index 27e781a..70ccb3e 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/JaxrsResource.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/JaxrsResource.java
@@ -93,6 +93,9 @@ public interface JaxrsResource {
     public static final String QUERY_PAY_ALL_UNPAID_INVOICES = "payAllUnpaidInvoices";
     public static final String QUERY_PAY_INVOICE = "payInvoice";
 
+    public static final String QUERY_START_TIME = "startTime";
+    public static final String QUERY_END_TIME = "endTime";
+
     public static final String QUERY_BUNDLE_TRANSFER_ADDON = "transferAddOn";
     public static final String QUERY_BUNDLE_TRANSFER_CANCEL_IMM = "cancelImmediately";
 
@@ -165,6 +168,9 @@ public interface JaxrsResource {
     public static final String TENANTS = "tenants";
     public static final String TENANTS_PATH = PREFIX + "/" + TENANTS;
 
+    public static final String USAGES = "usages";
+    public static final String USAGES_PATH = PREFIX + "/" + USAGES;
+
     public static final String EXPORT = "export";
     public static final String EXPORT_PATH = PREFIX + "/" + EXPORT;
 
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/SubscriptionResource.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/SubscriptionResource.java
index deee259..c98ecea 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/SubscriptionResource.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/SubscriptionResource.java
@@ -214,7 +214,7 @@ public class SubscriptionResource extends JaxRsResourceBase {
                     newEntitlement = current.changePlanOverrideBillingPolicy(entitlement.getProductName(), BillingPeriod.valueOf(entitlement.getBillingPeriod()), entitlement.getPriceList(), inputLocalDate, policy, ctx);
                 }
                 isImmediateOp = newEntitlement.getLastActiveProduct().getName().equals(entitlement.getProductName()) &&
-                                newEntitlement.getLastActivePlan().getBillingPeriod() == BillingPeriod.valueOf(entitlement.getBillingPeriod()) &&
+                                newEntitlement.getLastActivePlan().getRecurringBillingPeriod() == BillingPeriod.valueOf(entitlement.getBillingPeriod()) &&
                                 newEntitlement.getLastActivePriceList().getName().equals(entitlement.getPriceList());
                 return Response.status(Status.OK).build();
             }
diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/UsageResource.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/UsageResource.java
new file mode 100644
index 0000000..1d8d781
--- /dev/null
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/resources/UsageResource.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * The Billing Project licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.jaxrs.resources;
+
+import java.util.UUID;
+
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.core.UriInfo;
+
+import org.joda.time.DateTime;
+import org.killbill.billing.account.api.AccountUserApi;
+import org.killbill.billing.jaxrs.json.UsageJson;
+import org.killbill.billing.jaxrs.util.Context;
+import org.killbill.billing.jaxrs.util.JaxrsUriBuilder;
+import org.killbill.billing.usage.api.RolledUpUsage;
+import org.killbill.billing.usage.api.UsageUserApi;
+import org.killbill.billing.util.api.AuditUserApi;
+import org.killbill.billing.util.api.CustomFieldUserApi;
+import org.killbill.billing.util.api.TagUserApi;
+import org.killbill.billing.util.callcontext.CallContext;
+import org.killbill.billing.util.callcontext.TenantContext;
+import org.killbill.clock.Clock;
+
+import com.google.inject.Singleton;
+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
+
+@Singleton
+@Path(JaxrsResource.USAGES_PATH)
+public class UsageResource extends JaxRsResourceBase {
+
+    private final UsageUserApi usageUserApi;
+
+    @Inject
+    public UsageResource(final JaxrsUriBuilder uriBuilder,
+                         final TagUserApi tagUserApi,
+                         final CustomFieldUserApi customFieldUserApi,
+                         final AuditUserApi auditUserApi,
+                         final AccountUserApi accountUserApi,
+                         final UsageUserApi usageUserApi,
+                         final Clock clock,
+                         final Context context) {
+        super(uriBuilder, tagUserApi, customFieldUserApi, auditUserApi, accountUserApi, clock, context);
+        this.usageUserApi = usageUserApi;
+    }
+
+    @POST
+    @Consumes(APPLICATION_JSON)
+    @Produces(APPLICATION_JSON)
+    public Response recordUsage(final UsageJson json,
+                                  @HeaderParam(HDR_CREATED_BY) final String createdBy,
+                                  @HeaderParam(HDR_REASON) final String reason,
+                                  @HeaderParam(HDR_COMMENT) final String comment,
+                                  @javax.ws.rs.core.Context final HttpServletRequest request,
+                                  @javax.ws.rs.core.Context final UriInfo uriInfo)  {
+
+        final CallContext callContext = context.createContext(createdBy, reason, comment, request);
+        usageUserApi.recordRolledUpUsage(UUID.fromString(json.getSubscriptionId()), json.getUnitType(), json.getStartTime(), json.getEndTime(), json.getAmount(), callContext);
+        return Response.status(Status.CREATED).build();
+    }
+
+    @GET
+    @Path("/{subscriptionId:" + UUID_PATTERN + "}/{unitType}")
+    @Produces(APPLICATION_JSON)
+    public Response getUsage(@PathParam("subscriptionId") final String subscriptionId,
+                               @PathParam("unitType") final String unitType,
+                               @QueryParam(QUERY_START_TIME) final String startTime,
+                               @QueryParam(QUERY_END_TIME) final String endTime,
+                               @javax.ws.rs.core.Context final HttpServletRequest request)  {
+
+        final TenantContext tenantContext = context.createContext(request);
+
+        final DateTime usageStartTime = DATE_TIME_FORMATTER.parseDateTime(startTime);
+        final DateTime usageEndTime = DATE_TIME_FORMATTER.parseDateTime(endTime);
+
+        final RolledUpUsage usage = usageUserApi.getUsageForSubscription(UUID.fromString(subscriptionId), unitType, usageStartTime, usageEndTime, tenantContext);
+        final UsageJson result = new UsageJson(usage);
+        return Response.status(Status.OK).entity(result).build();
+    }
+
+}
+
diff --git a/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestInvoiceItemJsonSimple.java b/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestInvoiceItemJsonSimple.java
index 798c454..96eb7a7 100644
--- a/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestInvoiceItemJsonSimple.java
+++ b/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestInvoiceItemJsonSimple.java
@@ -44,6 +44,7 @@ public class TestInvoiceItemJsonSimple extends JaxrsTestSuiteNoDB {
         final String subscriptionId = UUID.randomUUID().toString();
         final String planName = UUID.randomUUID().toString();
         final String phaseName = UUID.randomUUID().toString();
+        final String usageName = UUID.randomUUID().toString();
         final String type = "FIXED";
         final String description = UUID.randomUUID().toString();
         final LocalDate startDate = clock.getUTCToday();
@@ -52,7 +53,7 @@ public class TestInvoiceItemJsonSimple extends JaxrsTestSuiteNoDB {
         final Currency currency = Currency.MXN;
         final List<AuditLogJson> auditLogs = createAuditLogsJson(clock.getUTCNow());
         final InvoiceItemJson invoiceItemJson = new InvoiceItemJson(invoiceItemId, invoiceId, linkedInvoiceItemId, accountId,
-                                                                                      bundleId, subscriptionId, planName, phaseName, type, description,
+                                                                                      bundleId, subscriptionId, planName, phaseName, usageName, type, description,
                                                                                       startDate, endDate, amount, currency, auditLogs);
         Assert.assertEquals(invoiceItemJson.getInvoiceItemId(), invoiceItemId);
         Assert.assertEquals(invoiceItemJson.getInvoiceId(), invoiceId);
@@ -62,6 +63,7 @@ public class TestInvoiceItemJsonSimple extends JaxrsTestSuiteNoDB {
         Assert.assertEquals(invoiceItemJson.getSubscriptionId(), subscriptionId);
         Assert.assertEquals(invoiceItemJson.getPlanName(), planName);
         Assert.assertEquals(invoiceItemJson.getPhaseName(), phaseName);
+        Assert.assertEquals(invoiceItemJson.getUsageName(), usageName);
         Assert.assertEquals(invoiceItemJson.getItemType(), type);
         Assert.assertEquals(invoiceItemJson.getDescription(), description);
         Assert.assertEquals(invoiceItemJson.getStartDate(), startDate);
@@ -86,6 +88,7 @@ public class TestInvoiceItemJsonSimple extends JaxrsTestSuiteNoDB {
         Mockito.when(invoiceItem.getSubscriptionId()).thenReturn(UUID.randomUUID());
         Mockito.when(invoiceItem.getPlanName()).thenReturn(UUID.randomUUID().toString());
         Mockito.when(invoiceItem.getPhaseName()).thenReturn(UUID.randomUUID().toString());
+        Mockito.when(invoiceItem.getUsageName()).thenReturn(UUID.randomUUID().toString());
         Mockito.when(invoiceItem.getDescription()).thenReturn(UUID.randomUUID().toString());
         Mockito.when(invoiceItem.getStartDate()).thenReturn(clock.getUTCToday());
         Mockito.when(invoiceItem.getEndDate()).thenReturn(clock.getUTCToday());
@@ -102,6 +105,7 @@ public class TestInvoiceItemJsonSimple extends JaxrsTestSuiteNoDB {
         Assert.assertEquals(invoiceItemJson.getSubscriptionId(), invoiceItem.getSubscriptionId().toString());
         Assert.assertEquals(invoiceItemJson.getPlanName(), invoiceItem.getPlanName());
         Assert.assertEquals(invoiceItemJson.getPhaseName(), invoiceItem.getPhaseName());
+        Assert.assertEquals(invoiceItemJson.getUsageName(), invoiceItem.getUsageName());
         Assert.assertEquals(invoiceItemJson.getDescription(), invoiceItem.getDescription());
         Assert.assertEquals(invoiceItemJson.getStartDate(), invoiceItem.getStartDate());
         Assert.assertEquals(invoiceItemJson.getEndDate(), invoiceItem.getEndDate());
diff --git a/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestRefundJson.java b/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestRefundJson.java
index 2e13a40..2c99fcc 100644
--- a/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestRefundJson.java
+++ b/jaxrs/src/test/java/org/killbill/billing/jaxrs/json/TestRefundJson.java
@@ -73,6 +73,7 @@ public class TestRefundJson extends JaxrsTestSuiteNoDB {
         final String subscriptionId = UUID.randomUUID().toString();
         final String planName = UUID.randomUUID().toString();
         final String phaseName = UUID.randomUUID().toString();
+        final String usageName = UUID.randomUUID().toString();
         final String description = UUID.randomUUID().toString();
         final LocalDate startDate = clock.getUTCToday();
         final LocalDate endDate = clock.getUTCToday();
@@ -81,7 +82,7 @@ public class TestRefundJson extends JaxrsTestSuiteNoDB {
         final Currency currency = Currency.MXN;
         final List<AuditLogJson> auditLogs = createAuditLogsJson(clock.getUTCNow());
         return new InvoiceItemJson(invoiceItemId, invoiceId, linkedInvoiceItemId, accountId, bundleId, subscriptionId,
-                                         planName, phaseName, type, description, startDate, endDate,
+                                         planName, phaseName, usageName, type, description, startDate, endDate,
                                          amount, currency, auditLogs);
     }
 }
diff --git a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java
index dd33853..4cdfd36 100644
--- a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java
+++ b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BillCycleDayCalculator.java
@@ -20,6 +20,7 @@ import java.util.List;
 
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
+import org.killbill.billing.catalog.api.BillingPeriod;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -75,10 +76,11 @@ public class BillCycleDayCalculator {
 
         final PlanPhase phase = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ? nextPhase : prevPhase;
 
+        final BillingPeriod billingPeriod = phase.getRecurring() != null ? phase.getRecurring().getBillingPeriod() : BillingPeriod.NO_BILLING_PERIOD;
         final BillingAlignment alignment = catalog.billingAlignment(
                 new PlanPhaseSpecifier(product.getName(),
                                        product.getCategory(),
-                                       phase.getBillingPeriod(),
+                                       billingPeriod,
                                        transition.getNextPriceList(),
                                        phase.getPhaseType()),
                 transition.getRequestedTransitionTime());
diff --git a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BlockingCalculator.java b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BlockingCalculator.java
index c651e18..ad95690 100644
--- a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BlockingCalculator.java
+++ b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/BlockingCalculator.java
@@ -32,13 +32,13 @@ import org.joda.time.DateTimeZone;
 
 import org.killbill.billing.account.api.Account;
 import org.killbill.billing.callcontext.InternalTenantContext;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.killbill.billing.catalog.api.BillingPeriod;
 import org.killbill.billing.catalog.api.Currency;
 import org.killbill.billing.catalog.api.Plan;
 import org.killbill.billing.catalog.api.PlanPhase;
 import org.killbill.billing.entitlement.api.BlockingState;
 import org.killbill.billing.junction.BillingEvent;
-import org.killbill.billing.junction.BillingModeType;
 import org.killbill.billing.junction.BlockingInternalApi;
 import org.killbill.billing.subscription.api.SubscriptionBase;
 import org.killbill.billing.subscription.api.SubscriptionBaseTransitionType;
@@ -204,14 +204,14 @@ public class BlockingCalculator {
 
         final Currency currency = previousEvent.getCurrency();
         final String description = "";
-        final BillingModeType billingModeType = previousEvent.getBillingMode();
+        final BillingMode billingMode = previousEvent.getBillingMode();
         final SubscriptionBaseTransitionType type = SubscriptionBaseTransitionType.START_BILLING_DISABLED;
         final Long totalOrdering = globaltotalOrder.getAndIncrement();
         final DateTimeZone tz = previousEvent.getTimeZone();
 
         return new DefaultBillingEvent(account, subscription, effectiveDate, plan, planPhase,
                                        fixedPrice, recurringPrice, currency,
-                                       billingPeriod, billCycleDay, billingModeType,
+                                       billingPeriod, billCycleDay, billingMode,
                                        description, totalOrdering, type, tz);
     }
 
@@ -227,7 +227,7 @@ public class BlockingCalculator {
         final BigDecimal recurringPrice = previousEvent.getRecurringPrice();
         final Currency currency = previousEvent.getCurrency();
         final String description = "";
-        final BillingModeType billingModeType = previousEvent.getBillingMode();
+        final BillingMode billingMode  = previousEvent.getBillingMode();
         final BillingPeriod billingPeriod = previousEvent.getBillingPeriod();
         final SubscriptionBaseTransitionType type = SubscriptionBaseTransitionType.END_BILLING_DISABLED;
         final Long totalOrdering = globaltotalOrder.getAndIncrement();
@@ -235,7 +235,7 @@ public class BlockingCalculator {
 
         return new DefaultBillingEvent(account, subscription, effectiveDate, plan, planPhase,
                                        fixedPrice, recurringPrice, currency,
-                                       billingPeriod, billCycleDay, billingModeType,
+                                       billingPeriod, billCycleDay, billingMode,
                                        description, totalOrdering, type, tz);
     }
 
diff --git a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultBillingEvent.java b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultBillingEvent.java
index 10fea39..54cffc5 100644
--- a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultBillingEvent.java
+++ b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultBillingEvent.java
@@ -17,22 +17,30 @@
 package org.killbill.billing.junction.plumbing.billing;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.annotation.Nullable;
 
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 
 import org.killbill.billing.account.api.Account;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.killbill.billing.catalog.api.BillingPeriod;
 import org.killbill.billing.catalog.api.Catalog;
 import org.killbill.billing.catalog.api.CatalogApiException;
 import org.killbill.billing.catalog.api.Currency;
 import org.killbill.billing.catalog.api.Plan;
 import org.killbill.billing.catalog.api.PlanPhase;
+import org.killbill.billing.catalog.api.Usage;
 import org.killbill.billing.subscription.api.SubscriptionBaseTransitionType;
 import org.killbill.billing.subscription.api.SubscriptionBase;
 import org.killbill.billing.events.EffectiveSubscriptionInternalEvent;
 import org.killbill.billing.junction.BillingEvent;
-import org.killbill.billing.junction.BillingModeType;
+
+import com.google.common.collect.Lists;
 
 public class DefaultBillingEvent implements BillingEvent {
     private final Account account;
@@ -45,25 +53,27 @@ public class DefaultBillingEvent implements BillingEvent {
     private final BigDecimal recurringPrice;
     private final Currency currency;
     private final String description;
-    private final BillingModeType billingModeType;
+    private final BillingMode billingMode;
     private final BillingPeriod billingPeriod;
     private final SubscriptionBaseTransitionType type;
     private final Long totalOrdering;
     private final DateTimeZone timeZone;
 
+    private final List<Usage> usages;
+
     public DefaultBillingEvent(final Account account, final EffectiveSubscriptionInternalEvent transition, final SubscriptionBase subscription, final int billCycleDayLocal, final Currency currency, final Catalog catalog) throws CatalogApiException {
 
         this.account = account;
         this.billCycleDayLocal = billCycleDayLocal;
         this.subscription = subscription;
-        effectiveDate = transition.getEffectiveTransitionTime();
+        this.effectiveDate = transition.getEffectiveTransitionTime();
         final String planPhaseName = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ?
                 transition.getNextPhase() : transition.getPreviousPhase();
-        planPhase = (planPhaseName != null) ? catalog.findPhase(planPhaseName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
+        this.planPhase = (planPhaseName != null) ? catalog.findPhase(planPhaseName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
 
         final String planName = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ?
                 transition.getNextPlan() : transition.getPreviousPlan();
-        plan = (planName != null) ? catalog.findPlan(planName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
+        this.plan = (planName != null) ? catalog.findPlan(planName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
 
         final String nextPhaseName = transition.getNextPhase();
         final PlanPhase nextPhase = (nextPhaseName != null) ? catalog.findPhase(nextPhaseName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
@@ -72,22 +82,23 @@ public class DefaultBillingEvent implements BillingEvent {
         final PlanPhase prevPhase = (prevPhaseName != null) ? catalog.findPhase(prevPhaseName, transition.getEffectiveTransitionTime(), transition.getSubscriptionStartDate()) : null;
 
 
-        fixedPrice = (nextPhase != null && nextPhase.getFixedPrice() != null) ? nextPhase.getFixedPrice().getPrice(currency) : null;
-        recurringPrice = (nextPhase != null && nextPhase.getRecurringPrice() != null) ? nextPhase.getRecurringPrice().getPrice(currency) : null;
+        this.fixedPrice = getFixedPrice(nextPhase, currency);
+        this.recurringPrice = getRecurringPrice(nextPhase, currency);
 
         this.currency = currency;
-        description = transition.getTransitionType().toString();
-        billingModeType = BillingModeType.IN_ADVANCE;
-        billingPeriod = (transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ?
-                nextPhase.getBillingPeriod() : prevPhase.getBillingPeriod();
-        type = transition.getTransitionType();
-        totalOrdering = transition.getTotalOrdering();
-        timeZone = account.getTimeZone();
+        this.description = transition.getTransitionType().toString();
+        this.billingMode = BillingMode.IN_ADVANCE;
+        this.billingPeriod = getRecurringBillingPeriod((transition.getTransitionType() != SubscriptionBaseTransitionType.CANCEL) ? nextPhase : prevPhase);
+        this.type = transition.getTransitionType();
+        this.totalOrdering = transition.getTotalOrdering();
+        this.timeZone = account.getTimeZone();
+        this.usages = initializeUsage();
     }
 
+
     public DefaultBillingEvent(final Account account, final SubscriptionBase subscription, final DateTime effectiveDate, final Plan plan, final PlanPhase planPhase,
                                final BigDecimal fixedPrice, final BigDecimal recurringPrice, final Currency currency,
-                               final BillingPeriod billingPeriod, final int billCycleDayLocal, final BillingModeType billingModeType,
+                               final BillingPeriod billingPeriod, final int billCycleDayLocal, final BillingMode billingMode,
                                final String description, final long totalOrdering, final SubscriptionBaseTransitionType type, final DateTimeZone timeZone) {
         this.account = account;
         this.subscription = subscription;
@@ -99,11 +110,13 @@ public class DefaultBillingEvent implements BillingEvent {
         this.currency = currency;
         this.billingPeriod = billingPeriod;
         this.billCycleDayLocal = billCycleDayLocal;
-        this.billingModeType = billingModeType;
+        this.billingMode = billingMode;
         this.description = description;
         this.type = type;
         this.totalOrdering = totalOrdering;
         this.timeZone = timeZone;
+        this.usages = initializeUsage();
+
     }
 
     @Override
@@ -188,8 +201,8 @@ public class DefaultBillingEvent implements BillingEvent {
     }
 
     @Override
-    public BillingModeType getBillingMode() {
-        return billingModeType;
+    public BillingMode getBillingMode() {
+        return billingMode;
     }
 
     @Override
@@ -223,6 +236,17 @@ public class DefaultBillingEvent implements BillingEvent {
     }
 
     @Override
+    public DateTimeZone getTimeZone() {
+        return timeZone;
+    }
+
+    @Override
+    public List<Usage> getUsages() {
+        return usages;
+    }
+
+
+    @Override
     public String toString() {
         // Note: we don't use all fields here, as the output would be overwhelming
         // (these events are printed in the logs in junction and invoice).
@@ -255,7 +279,7 @@ public class DefaultBillingEvent implements BillingEvent {
         if (account != null ? !account.equals(that.account) : that.account != null) {
             return false;
         }
-        if (billingModeType != that.billingModeType) {
+        if (billingMode != that.billingMode) {
             return false;
         }
         if (billingPeriod != that.billingPeriod) {
@@ -310,7 +334,7 @@ public class DefaultBillingEvent implements BillingEvent {
         result = 31 * result + (recurringPrice != null ? recurringPrice.hashCode() : 0);
         result = 31 * result + (currency != null ? currency.hashCode() : 0);
         result = 31 * result + (description != null ? description.hashCode() : 0);
-        result = 31 * result + (billingModeType != null ? billingModeType.hashCode() : 0);
+        result = 31 * result + (billingMode != null ? billingMode.hashCode() : 0);
         result = 31 * result + (billingPeriod != null ? billingPeriod.hashCode() : 0);
         result = 31 * result + (type != null ? type.hashCode() : 0);
         result = 31 * result + (totalOrdering != null ? totalOrdering.hashCode() : 0);
@@ -318,8 +342,30 @@ public class DefaultBillingEvent implements BillingEvent {
         return result;
     }
 
-    @Override
-    public DateTimeZone getTimeZone() {
-        return timeZone;
+
+    private BigDecimal getFixedPrice(@Nullable final PlanPhase nextPhase, final Currency currency) throws CatalogApiException {
+        return (nextPhase != null && nextPhase.getFixed() != null && nextPhase.getFixed().getPrice() != null) ? nextPhase.getFixed().getPrice().getPrice(currency) : null;
+    }
+
+    private BigDecimal getRecurringPrice(@Nullable final PlanPhase nextPhase, final Currency currency) throws CatalogApiException {
+        return (nextPhase != null && nextPhase.getRecurring() != null && nextPhase.getRecurring().getRecurringPrice() != null) ? nextPhase.getRecurring().getRecurringPrice().getPrice(currency) : null;
+    }
+
+    private BillingPeriod getRecurringBillingPeriod(@Nullable final PlanPhase nextPhase) {
+        if (nextPhase == null) {
+            return BillingPeriod.NO_BILLING_PERIOD;
+        }
+        return nextPhase.getRecurring() != null ? nextPhase.getRecurring().getBillingPeriod() : BillingPeriod.NO_BILLING_PERIOD;
+    }
+
+    private List<Usage> initializeUsage() {
+        List<Usage> result = Collections.<Usage>emptyList();
+        if (planPhase != null) {
+            result = Lists.newArrayList();
+            for (Usage usage : planPhase.getUsages()) {
+                result.add(usage);
+            }
+        }
+        return result;
     }
 }
diff --git a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultBillingEventSet.java b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultBillingEventSet.java
index 4b59c9b..4586db9 100644
--- a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultBillingEventSet.java
+++ b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultBillingEventSet.java
@@ -17,19 +17,35 @@
 package org.killbill.billing.junction.plumbing.billing;
 
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.UUID;
 
+import javax.annotation.Nullable;
+
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Usage;
 import org.killbill.billing.junction.BillingEvent;
 import org.killbill.billing.junction.BillingEventSet;
 
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
 public class DefaultBillingEventSet extends TreeSet<BillingEvent> implements SortedSet<BillingEvent>, BillingEventSet {
+
     private static final long serialVersionUID = 1L;
 
     private boolean accountAutoInvoiceOff = false;
     private List<UUID> subscriptionIdsWithAutoInvoiceOff = new ArrayList<UUID>();
+    private BillingMode recurrringBillingMode;
 
     /* (non-Javadoc)
     * @see org.killbill.billing.junction.plumbing.billing.BillingEventSet#isAccountAutoInvoiceOff()
@@ -39,6 +55,11 @@ public class DefaultBillingEventSet extends TreeSet<BillingEvent> implements Sor
         return accountAutoInvoiceOff;
     }
 
+    @Override
+    public BillingMode getRecurringBillingMode() {
+        return null;
+    }
+
     /* (non-Javadoc)
     * @see org.killbill.billing.junction.plumbing.billing.BillingEventSet#getSubscriptionIdsWithAutoInvoiceOff()
     */
@@ -47,20 +68,41 @@ public class DefaultBillingEventSet extends TreeSet<BillingEvent> implements Sor
         return subscriptionIdsWithAutoInvoiceOff;
     }
 
+    @Override
+    public Map<String, Usage> getUsages() {
+        final Iterable<Usage> allUsages = Iterables.concat(Iterables.transform(this, new Function<BillingEvent, List<Usage>>() {
+            @Override
+            public List<Usage> apply(final BillingEvent input) {
+                return input.getUsages();
+            }
+        }));
+        if (!allUsages.iterator().hasNext()) {
+            return Collections.emptyMap();
+        }
+        final Map<String, Usage> result = new HashMap<String, Usage>();
+        for (Usage cur : Sets.<Usage>newHashSet(allUsages)) {
+            result.put(cur.getName(), cur);
+        }
+        return result;
+    }
+
     public void setAccountAutoInvoiceIsOff(final boolean accountAutoInvoiceIsOff) {
         this.accountAutoInvoiceOff = accountAutoInvoiceIsOff;
     }
 
-    public void setSubscriptionIdsWithAutoInvoiceOff(final List<UUID> subscriptionIdsWithAutoInvoiceOff) {
-        this.subscriptionIdsWithAutoInvoiceOff = subscriptionIdsWithAutoInvoiceOff;
+    public BillingMode getRecurrringBillingMode() {
+        return recurrringBillingMode;
+    }
+
+    public void setRecurrringBillingMode(final BillingMode recurrringBillingMode) {
+        this.recurrringBillingMode = recurrringBillingMode;
     }
 
     @Override
     public String toString() {
         return "DefaultBillingEventSet [accountAutoInvoiceOff=" + accountAutoInvoiceOff
-                + ", subscriptionIdsWithAutoInvoiceOff=" + subscriptionIdsWithAutoInvoiceOff + ", Events="
-                + super.toString() + "]";
+               + ", subscriptionIdsWithAutoInvoiceOff=" + subscriptionIdsWithAutoInvoiceOff + ", Events="
+               + super.toString() + "]";
     }
 
-
 }
diff --git a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
index 01d1d3c..daa9a47 100644
--- a/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
+++ b/junction/src/main/java/org/killbill/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
@@ -22,6 +22,13 @@ import java.util.UUID;
 
 import javax.annotation.Nullable;
 
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.BillingMode;
+import org.killbill.billing.catalog.api.Usage;
+import org.killbill.billing.util.timezone.DateAndTimeZoneContext;
+import org.killbill.clock.Clock;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,25 +64,30 @@ public class DefaultInternalBillingApi implements BillingInternalApi {
     private final CatalogService catalogService;
     private final BlockingCalculator blockCalculator;
     private final TagInternalApi tagApi;
+    private final Clock clock;
 
     @Inject
     public DefaultInternalBillingApi(final AccountInternalApi accountApi,
                                      final BillCycleDayCalculator bcdCalculator,
                                      final SubscriptionBaseInternalApi subscriptionApi,
                                      final BlockingCalculator blockCalculator,
-                                     final CatalogService catalogService, final TagInternalApi tagApi) {
+                                     final CatalogService catalogService,
+                                     final TagInternalApi tagApi,
+                                     final Clock clock) {
         this.accountApi = accountApi;
         this.bcdCalculator = bcdCalculator;
         this.subscriptionApi = subscriptionApi;
         this.catalogService = catalogService;
         this.blockCalculator = blockCalculator;
         this.tagApi = tagApi;
+        this.clock = clock;
     }
 
     @Override
     public BillingEventSet getBillingEventsForAccountAndUpdateAccountBCD(final UUID accountId, final InternalCallContext context) {
         final List<SubscriptionBaseBundle> bundles = subscriptionApi.getBundlesForAccount(accountId, context);
         final DefaultBillingEventSet result = new DefaultBillingEventSet();
+        result.setRecurrringBillingMode(catalogService.getCurrentCatalog().getRecurringBillingMode());
 
         try {
             final Account account = accountApi.getAccountById(accountId, context);
diff --git a/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestBillingApi.java b/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestBillingApi.java
index 9d677a4..6cd947f 100644
--- a/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestBillingApi.java
+++ b/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestBillingApi.java
@@ -22,6 +22,7 @@ import org.killbill.billing.account.api.Account;
 import org.killbill.billing.account.api.AccountApiException;
 import org.killbill.billing.catalog.MockCatalog;
 import org.killbill.billing.catalog.api.BillingAlignment;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.killbill.billing.catalog.api.CatalogApiException;
 import org.killbill.billing.catalog.api.Currency;
 import org.killbill.billing.catalog.api.InternationalPrice;
@@ -33,7 +34,6 @@ import org.killbill.billing.entitlement.api.BlockingStateType;
 import org.killbill.billing.entitlement.api.Entitlement.EntitlementState;
 import org.killbill.billing.entitlement.dao.MockBlockingStateDao;
 import org.killbill.billing.junction.JunctionTestSuiteNoDB;
-import org.killbill.billing.entitlement.api.BlockingState;
 import org.killbill.billing.mock.MockEffectiveSubscriptionEvent;
 import org.killbill.billing.mock.MockSubscription;
 import org.killbill.billing.subscription.api.SubscriptionBaseTransitionType;
@@ -44,7 +44,6 @@ import org.killbill.billing.callcontext.InternalTenantContext;
 import org.killbill.billing.events.EffectiveSubscriptionInternalEvent;
 import org.killbill.billing.junction.BillingEvent;
 import org.killbill.billing.junction.BillingEventSet;
-import org.killbill.billing.junction.BillingModeType;
 import org.killbill.billing.junction.DefaultBlockingState;
 import org.killbill.billing.util.tag.ControlTagType;
 import org.killbill.billing.util.tag.dao.MockTagDao;
@@ -55,7 +54,6 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
@@ -189,9 +187,9 @@ public class TestBillingApi extends JunctionTestSuiteNoDB {
         Assert.assertEquals(events.size(), 3);
         final Iterator<BillingEvent> it = events.iterator();
 
-        checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now, nextPhase, SubscriptionBaseTransitionType.CREATE.toString(), nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
+        checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now, nextPhase, SubscriptionBaseTransitionType.CREATE.toString(), nextPhase.getFixed().getPrice(), nextPhase.getRecurring().getRecurringPrice());
         checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now.plusDays(1), nextPhase, SubscriptionBaseTransitionType.START_BILLING_DISABLED.toString(), null, null);
-        checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now.plusDays(2), nextPhase, SubscriptionBaseTransitionType.END_BILLING_DISABLED.toString(), nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
+        checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now.plusDays(2), nextPhase, SubscriptionBaseTransitionType.END_BILLING_DISABLED.toString(), nextPhase.getFixed().getPrice(), nextPhase.getRecurring().getRecurringPrice());
     }
 
     @Test(groups = "fast")
@@ -230,7 +228,7 @@ public class TestBillingApi extends JunctionTestSuiteNoDB {
     private void checkFirstEvent(final SortedSet<BillingEvent> events, final Plan nextPlan,
                                  final int BCD, final UUID id, final DateTime time, final PlanPhase nextPhase, final String desc) throws CatalogApiException {
         Assert.assertEquals(events.size(), 1);
-        checkEvent(events.first(), nextPlan, BCD, id, time, nextPhase, desc, nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
+        checkEvent(events.first(), nextPlan, BCD, id, time, nextPhase, desc, nextPhase.getFixed().getPrice(), nextPhase.getRecurring().getRecurringPrice());
     }
 
     private void checkEvent(final BillingEvent event, final Plan nextPlan, final int BCD, final UUID id, final DateTime time,
@@ -253,9 +251,9 @@ public class TestBillingApi extends JunctionTestSuiteNoDB {
         Assert.assertEquals(nextPhase, event.getPlanPhase());
         Assert.assertEquals(nextPlan, event.getPlan());
         if (!SubscriptionBaseTransitionType.START_BILLING_DISABLED.equals(event.getTransitionType())) {
-            Assert.assertEquals(nextPhase.getBillingPeriod(), event.getBillingPeriod());
+            Assert.assertEquals(nextPhase.getRecurring().getBillingPeriod(), event.getBillingPeriod());
         }
-        Assert.assertEquals(BillingModeType.IN_ADVANCE, event.getBillingMode());
+        Assert.assertEquals(BillingMode.IN_ADVANCE, event.getBillingMode());
         Assert.assertEquals(desc, event.getTransitionType().toString());
     }
 
diff --git a/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestBlockingCalculator.java b/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestBlockingCalculator.java
index 7425e0f..867ba4f 100644
--- a/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestBlockingCalculator.java
+++ b/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestBlockingCalculator.java
@@ -28,6 +28,7 @@ import java.util.UUID;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 import org.joda.time.LocalDate;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.mockito.Mockito;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -43,7 +44,6 @@ import org.killbill.billing.entitlement.api.BlockingState;
 import org.killbill.billing.entitlement.api.BlockingStateType;
 import org.killbill.billing.entitlement.dao.MockBlockingStateDao;
 import org.killbill.billing.junction.BillingEvent;
-import org.killbill.billing.junction.BillingModeType;
 import org.killbill.billing.junction.DefaultBlockingState;
 import org.killbill.billing.junction.JunctionTestSuiteNoDB;
 import org.killbill.billing.junction.plumbing.billing.BlockingCalculator.DisabledDuration;
@@ -532,7 +532,7 @@ public class TestBlockingCalculator extends JunctionTestSuiteNoDB {
         final BigDecimal recurringPrice = BigDecimal.TEN;
         final Currency currency = Currency.USD;
         final String description = "";
-        final BillingModeType billingModeType = BillingModeType.IN_ADVANCE;
+        final BillingMode billingModeType = BillingMode.IN_ADVANCE;
         final BillingPeriod billingPeriod = BillingPeriod.MONTHLY;
         final Long totalOrdering = 0L;
         final DateTimeZone tz = DateTimeZone.UTC;
@@ -610,7 +610,7 @@ public class TestBlockingCalculator extends JunctionTestSuiteNoDB {
 
         public MockBillingEvent() {
             super(account, subscription1, clock.getUTCNow(), null, null, BigDecimal.ZERO, BigDecimal.TEN, Currency.USD, BillingPeriod.ANNUAL,
-                  4, BillingModeType.IN_ADVANCE, "", 3L, SubscriptionBaseTransitionType.CREATE, DateTimeZone.UTC);
+                  4, BillingMode.IN_ADVANCE, "", 3L, SubscriptionBaseTransitionType.CREATE, DateTimeZone.UTC);
         }
     }
 
diff --git a/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestDefaultBillingEvent.java b/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestDefaultBillingEvent.java
index cb25cc1..79b50ea 100644
--- a/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestDefaultBillingEvent.java
+++ b/junction/src/test/java/org/killbill/billing/junction/plumbing/billing/TestDefaultBillingEvent.java
@@ -26,6 +26,7 @@ import javax.annotation.Nullable;
 
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
+import org.killbill.billing.catalog.api.BillingMode;
 import org.mockito.Mockito;
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -45,7 +46,6 @@ import org.killbill.billing.subscription.api.SubscriptionBase;
 import org.killbill.billing.junction.JunctionTestSuiteNoDB;
 import org.killbill.billing.mock.MockAccountBuilder;
 import org.killbill.billing.junction.BillingEvent;
-import org.killbill.billing.junction.BillingModeType;
 
 public class TestDefaultBillingEvent extends JunctionTestSuiteNoDB {
 
@@ -190,7 +190,7 @@ public class TestDefaultBillingEvent extends JunctionTestSuiteNoDB {
         return new DefaultBillingEvent(account, sub, effectiveDate,
                                        shotgun, shotgunMonthly,
                                        BigDecimal.ZERO, null, Currency.USD, BillingPeriod.NO_BILLING_PERIOD, billCycleDay,
-                                       BillingModeType.IN_ADVANCE, "Test Event 1", totalOrdering, type, DateTimeZone.UTC);
+                                       BillingMode.IN_ADVANCE, "Test Event 1", totalOrdering, type, DateTimeZone.UTC);
     }
 
     private MockPlanPhase createMockMonthlyPlanPhase(@Nullable final BigDecimal recurringRate,
diff --git a/junction/src/test/resources/junction.properties b/junction/src/test/resources/junction.properties
index 357561d..46a797b 100644
--- a/junction/src/test/resources/junction.properties
+++ b/junction/src/test/resources/junction.properties
@@ -1 +1 @@
-org.killbill.catalog.uri=file:src/test/resources/catalog.xml
+org.killbill.catalog.uri=catalogTest.xml
diff --git a/payment/src/test/java/org/killbill/billing/payment/api/TestPaymentApi.java b/payment/src/test/java/org/killbill/billing/payment/api/TestPaymentApi.java
index 1b38d97..25bd6dd 100644
--- a/payment/src/test/java/org/killbill/billing/payment/api/TestPaymentApi.java
+++ b/payment/src/test/java/org/killbill/billing/payment/api/TestPaymentApi.java
@@ -60,7 +60,7 @@ public class TestPaymentApi extends PaymentTestSuiteWithEmbeddedDB {
         invoice.addInvoiceItem(new MockRecurringInvoiceItem(invoice.getId(), account.getId(),
                                                             subscriptionId,
                                                             bundleId,
-                                                            "test plan", "test phase",
+                                                            "test plan", "test phase", null,
                                                             now,
                                                             now.plusMonths(1),
                                                             requestedAmount,
diff --git a/payment/src/test/java/org/killbill/billing/payment/api/TestPaymentApiNoDB.java b/payment/src/test/java/org/killbill/billing/payment/api/TestPaymentApiNoDB.java
index e45c453..5d85e82 100644
--- a/payment/src/test/java/org/killbill/billing/payment/api/TestPaymentApiNoDB.java
+++ b/payment/src/test/java/org/killbill/billing/payment/api/TestPaymentApiNoDB.java
@@ -108,7 +108,7 @@ public class TestPaymentApiNoDB extends PaymentTestSuiteNoDB {
         invoice.addInvoiceItem(new MockRecurringInvoiceItem(invoice.getId(), account.getId(),
                                                             subscriptionId,
                                                             bundleId,
-                                                            "test plan", "test phase",
+                                                            "test plan", "test phase", null,
                                                             now,
                                                             now.plusMonths(1),
                                                             invoiceAmount,
diff --git a/payment/src/test/java/org/killbill/billing/payment/MockRecurringInvoiceItem.java b/payment/src/test/java/org/killbill/billing/payment/MockRecurringInvoiceItem.java
index 864b402..cf3eb92 100644
--- a/payment/src/test/java/org/killbill/billing/payment/MockRecurringInvoiceItem.java
+++ b/payment/src/test/java/org/killbill/billing/payment/MockRecurringInvoiceItem.java
@@ -41,43 +41,44 @@ public class MockRecurringInvoiceItem extends EntityBase implements InvoiceItem 
     protected final LocalDate endDate;
     protected final BigDecimal amount;
     protected final Currency currency;
+    protected final String usageName;
 
     public MockRecurringInvoiceItem(final UUID invoiceId, final UUID accountId, final UUID bundleId, final UUID subscriptionId,
-                                    final String planName, final String phaseName, final LocalDate startDate, final LocalDate endDate,
+                                    final String planName, final String phaseName, final String usageName, final LocalDate startDate, final LocalDate endDate,
                                     final BigDecimal amount, final BigDecimal rate, final Currency currency) {
-        this(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amount, currency, rate, null);
+        this(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, currency, rate, null);
     }
 
     public MockRecurringInvoiceItem(final UUID invoiceId, final UUID accountId, final UUID bundleId, final UUID subscriptionId,
-                                    final String planName, final String phaseName, final LocalDate startDate, final LocalDate endDate,
+                                    final String planName, final String phaseName, final String usageName, final LocalDate startDate, final LocalDate endDate,
                                     final BigDecimal amount, final BigDecimal rate, final Currency currency, final UUID reversedItemId) {
-        this(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate,
+        this(invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate,
              amount, currency, rate, reversedItemId);
     }
 
     public MockRecurringInvoiceItem(final UUID id, final UUID invoiceId, final UUID accountId, final UUID bundleId,
-                                    final UUID subscriptionId, final String planName, final String phaseName,
+                                    final UUID subscriptionId, final String planName, final String phaseName, final String usageName,
                                     final LocalDate startDate, final LocalDate endDate, final BigDecimal amount,
                                     final BigDecimal rate, final Currency currency) {
-        this(id, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amount, currency, rate, null);
+        this(id, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, currency, rate, null);
 
     }
 
     public MockRecurringInvoiceItem(final UUID id, final UUID invoiceId, final UUID accountId, final UUID bundleId,
-                                    final UUID subscriptionId, final String planName, final String phaseName,
+                                    final UUID subscriptionId, final String planName, final String phaseName, final String usageName,
                                     final LocalDate startDate, final LocalDate endDate, final BigDecimal amount,
                                     final BigDecimal rate, final Currency currency, final UUID reversedItemId) {
-        this(id, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, startDate, endDate, amount, currency, rate, reversedItemId);
+        this(id, invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName, startDate, endDate, amount, currency, rate, reversedItemId);
     }
 
-    public MockRecurringInvoiceItem(final UUID invoiceId, final UUID accountId, final UUID bundleId, final UUID subscriptionId, final String planName, final String phaseName,
+    public MockRecurringInvoiceItem(final UUID invoiceId, final UUID accountId, final UUID bundleId, final UUID subscriptionId, final String planName, final String phaseName, final String usageName,
                                     final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final Currency currency, final BigDecimal rate, final UUID reversedItemId) {
-        this(UUID.randomUUID(), invoiceId, accountId, bundleId, subscriptionId, planName, phaseName,
+        this(UUID.randomUUID(), invoiceId, accountId, bundleId, subscriptionId, planName, phaseName, usageName,
              startDate, endDate, amount, currency, rate, reversedItemId);
     }
 
     public MockRecurringInvoiceItem(final UUID id, final UUID invoiceId, final UUID accountId, @Nullable final UUID bundleId, @Nullable final UUID subscriptionId, final String planName, final String phaseName,
-                                    final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final Currency currency,
+                                    final String usageName, final LocalDate startDate, final LocalDate endDate, final BigDecimal amount, final Currency currency,
                                     final BigDecimal rate, final UUID reversedItemId) {
         super(id);
         this.invoiceId = invoiceId;
@@ -86,6 +87,7 @@ public class MockRecurringInvoiceItem extends EntityBase implements InvoiceItem 
         this.bundleId = bundleId;
         this.planName = planName;
         this.phaseName = phaseName;
+        this.usageName = usageName;
         this.startDate = startDate;
         this.endDate = endDate;
         this.amount = amount;
@@ -130,6 +132,11 @@ public class MockRecurringInvoiceItem extends EntityBase implements InvoiceItem 
     }
 
     @Override
+    public String getUsageName() {
+        return usageName;
+    }
+
+    @Override
     public BigDecimal getAmount() {
         return amount;
     }
diff --git a/payment/src/test/java/org/killbill/billing/payment/TestPaymentHelper.java b/payment/src/test/java/org/killbill/billing/payment/TestPaymentHelper.java
index fb6fffe..9bdb5fe 100644
--- a/payment/src/test/java/org/killbill/billing/payment/TestPaymentHelper.java
+++ b/payment/src/test/java/org/killbill/billing/payment/TestPaymentHelper.java
@@ -82,6 +82,7 @@ public class TestPaymentHelper {
                                                                     recurringInvoiceItem.getSubscriptionId(),
                                                                     recurringInvoiceItem.getPlanName(),
                                                                     recurringInvoiceItem.getPhaseName(),
+                                                                    null,
                                                                     recurringInvoiceItem.getStartDate(),
                                                                     recurringInvoiceItem.getEndDate(),
                                                                     recurringInvoiceItem.getAmount(),
diff --git a/payment/src/test/java/org/killbill/billing/payment/TestRetryService.java b/payment/src/test/java/org/killbill/billing/payment/TestRetryService.java
index b64e047..be4208a 100644
--- a/payment/src/test/java/org/killbill/billing/payment/TestRetryService.java
+++ b/payment/src/test/java/org/killbill/billing/payment/TestRetryService.java
@@ -123,7 +123,7 @@ public class TestRetryService extends PaymentTestSuiteNoDB {
                                                             account.getId(),
                                                             subscriptionId,
                                                             bundleId,
-                                                            "test plan", "test phase",
+                                                            "test plan", "test phase", null,
                                                             startDate,
                                                             endDate,
                                                             amount,

pom.xml 2(+1 -1)

diff --git a/pom.xml b/pom.xml
index 0afffd7..077f38a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
     <parent>
         <artifactId>killbill-oss-parent</artifactId>
         <groupId>org.kill-bill.billing</groupId>
-        <version>0.5.30-SNAPSHOT</version>
+        <version>0.5.30</version>
     </parent>
     <artifactId>killbill</artifactId>
     <version>0.9.3-SNAPSHOT</version>

server/bitcoin.log 1037(+1037 -0)

diff --git a/server/bitcoin.log b/server/bitcoin.log
new file mode 100644
index 0000000..551858b
--- /dev/null
+++ b/server/bitcoin.log
@@ -0,0 +1,1037 @@
+4049 [WalletAppKit STARTING] INFO  c.g.bitcoin.core.AbstractBlockChain - chain head is at height 278446:
+v2 block: 
+   previous block: 00000000000000008790f50f88c04e640e644169c16ee47bd25849b566965ed3
+   merkle root: 7ea51c615a3c7cf6563ac671d3865f0501abafad7e55d2be559a906339754e3d
+   time: [1388764030] Fri Jan 03 15:47:10 UTC 2014
+   difficulty target (nBits): 419628831
+   nonce: 1111874632
+
+4143 [WalletAppKit STARTING] WARN  c.g.bitcoin.core.AbstractBlockChain - Wallet/chain height mismatch: 278443 vs 278446
+4143 [WalletAppKit STARTING] WARN  c.g.bitcoin.core.AbstractBlockChain - Hashes: 0000000000000002817bc24f6dc6641dcb1e57302c363be395054323679dbab0 vs 000000000000000059225b59ded12462c765be2381f4f9fc1590fd410f886813
+4579 [PeerGroup STARTING] INFO  com.google.bitcoin.core.PeerGroup - Peer discovery took 426msec
+4812 [New I/O worker #3] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bitcoin.dashjr.org/24.224.241.163:8333 as: /BitCoinJ:0.10.3/
+4901 [New I/O worker #2] INFO  c.g.b.core.TCPNetworkConnection - Announcing to seed.bitcoin.sipa.be/77.194.32.177:8333 as: /BitCoinJ:0.10.3/
+4905 [New I/O worker #4] INFO  c.g.b.core.TCPNetworkConnection - Announcing to seed.bitcoin.sipa.be/89.235.245.35:8333 as: /BitCoinJ:0.10.3/
+5002 [New I/O worker #3] INFO  c.g.b.core.TCPNetworkConnection - Connected to 24.224.241.163: version=70001, subVer='/Satoshi:0.8.5/', services=0x1, time=Tue Jan 07 00:32:37 UTC 2014, blocks=279018
+5147 [New I/O worker #3] INFO  com.google.bitcoin.core.PeerGroup - [24.224.241.163]:8333: New peer
+5148 [New I/O worker #3] INFO  com.google.bitcoin.core.PeerGroup - Setting download peer: [24.224.241.163]:8333
+5149 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Downloading block chain of size 572. 
+5189 [New I/O worker #4] INFO  c.g.b.core.TCPNetworkConnection - Connected to 89.235.245.35: version=70001, subVer='/Satoshi:0.8.5/', services=0x1, time=Tue Jan 07 00:32:46 UTC 2014, blocks=279018
+5258 [New I/O worker #2] INFO  c.g.b.core.TCPNetworkConnection - Connected to 77.194.32.177: version=70001, subVer='/Satoshi:0.8.5/', services=0x1, time=Tue Jan 07 00:32:39 UTC 2014, blocks=279018
+5474 [New I/O worker #4] INFO  com.google.bitcoin.core.PeerGroup - [89.235.245.35]:8333: New peer
+5501 [New I/O worker #2] INFO  com.google.bitcoin.core.PeerGroup - [77.194.32.177]:8333: New peer
+6659 [New I/O worker #1] INFO  com.google.bitcoin.core.PeerGroup - [101.28.51.40]:8333: Peer died
+6660 [New I/O boss #17] INFO  com.google.bitcoin.core.Peer - [101.28.51.40]:8333 - connection timed out
+6661 [New I/O worker #1] INFO  com.google.bitcoin.core.Peer - [2001:470:c1f2:3:0:0:0:201]:8333 - No route to host
+6661 [New I/O worker #5] INFO  com.google.bitcoin.core.PeerGroup - [2001:470:c1f2:3:0:0:0:201]:8333: Peer died
+6845 [New I/O worker #6] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bluematt.me/130.180.122.103:8333 as: /BitCoinJ:0.10.3/
+7029 [New I/O worker #6] INFO  com.google.bitcoin.core.PeerGroup - [130.180.122.103]:8333: Peer died
+7145 [New I/O worker #7] INFO  c.g.b.core.TCPNetworkConnection - Announcing to seed.bitcoin.sipa.be/209.6.90.175:8333 as: /BitCoinJ:0.10.3/
+7685 [New I/O worker #7] INFO  c.g.b.core.TCPNetworkConnection - Connected to 209.6.90.175: version=70001, subVer='/Satoshi:0.8.5/', services=0x1, time=Tue Jan 07 00:32:34 UTC 2014, blocks=279018
+7781 [New I/O worker #7] INFO  com.google.bitcoin.core.PeerGroup - [209.6.90.175]:8333: New peer
+12524 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278447/0000000000000001f2b9d6ab41eeb5b3f5a0d2bd28b13a28d225fe75138ebe39
+12532 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 8msec
+18072 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278448/0000000000000000adda2cd466b3e842c8f29a0a5771453caeba8072cc27863e
+18074 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+21933 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278449/0000000000000000f87a3718ab93223763ec52e262de43de20442ac237ebc98f
+21934 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+24105 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278450/0000000000000001da1455a71d9c0d7a7d3d3a2c3cf9ae98e631eb706ade7850
+24106 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+26281 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Chain download 1% done with 566 blocks to go, block date Jan 3, 2014 4:27:11 PM
+26916 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278452/00000000000000028186b790f5e3f9f227cf46a0a87afa28bd6cf4ec5db37cfa
+26918 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+31261 [New I/O worker #3] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+32272 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278453/000000000000000125cada0da30d51968f6bc245cc3f6b166e72830b18f70d21
+32274 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+36674 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278454/00000000000000022423af9a2ccbf0c6aae0bb9928d218c5d90fae38d5239d56
+36676 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+44803 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278456/000000000000000073934fc5e0cc024c1148f48c42a5375cafac308851010b62
+44805 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+47294 [New I/O worker #3] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+48303 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278457/0000000000000000e4d05b920abfd26d4fc2ffd69461d1277b1b9b8743c2589c
+48305 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+51597 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Chain download 2% done with 560 blocks to go, block date Jan 3, 2014 5:59:40 PM
+52597 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278458/0000000000000002c85e89367dfc9ca8e99eabcc4a4506b01bb29ffc2e86803a
+52599 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+54067 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278459/00000000000000010f887125c7038b86d92e6e0220f51651fe52b619d171d340
+54069 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+58075 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278460/000000000000000228229603ad6fe1e53b2cc4e775ce568f55676675c32e624d
+58077 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+63283 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278461/0000000000000000989156693a0869aa8851d9cf0e42e9a8cc1e8d49c7c1863e
+63285 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+79365 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278462/0000000000000001bafe98f5292b38260f3638507987284a032cb051a5ccf92b
+79367 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+84441 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278463/00000000000000028b3965f9c0c8050e06b4a5162281637655776fc775ad9b9c
+84442 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+87063 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Chain download 3% done with 554 blocks to go, block date Jan 3, 2014 6:36:22 PM
+88064 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278464/0000000000000001172229723a9ff7372bd28f4bf6f6b18838171a900ed314dc
+88066 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+94110 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278465/0000000000000000d26797cd1b2309bdd283e66fb31ea467cda5e6ab766a710a
+94112 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+95399 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278466/0000000000000000da80bd741e04ca7cc542c30fada703cd9331878ca48ac1e4
+95400 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+102456 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278467/00000000000000022a44ac62a13dba49fa5b8c56c329b109592402718452fa27
+102458 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+105997 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278468/00000000000000002f35b44287aedc97bfe6495cc536c84b421540d4d154cf43
+105999 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+107458 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Chain download 4% done with 549 blocks to go, block date Jan 3, 2014 7:11:59 PM
+108459 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278470/0000000000000000d576b2a8a8313fa7747a4d25eda56f1c2d7d6052f99daaea
+108461 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+111435 [New I/O worker #3] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+112438 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278471/000000000000000058a51e46fae8afdae604e1bf650477da16d93069e5bbeaa3
+112440 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+115096 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278472/0000000000000003002c57cf58926e63c93e521bf2134bf5afb7b29cf5ca6c57
+115097 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+118780 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278473/0000000000000002e0d156e32586074ab6cc0fdbb1a05d5cda168510c43e9a50
+118782 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+122352 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278474/0000000000000002e40b2dc429d3d19c2cd9c995547da97d9f3d0f68e60914a9
+122353 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+122659 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Chain download 5% done with 543 blocks to go, block date Jan 3, 2014 7:43:39 PM
+123659 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278475/0000000000000001b41ef8e9954b56aa05a2640d4a5c0344d705bf0e44ee141a
+123661 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+126019 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278476/000000000000000031da8aa8b98a646c4aed54c700f717a8553297038e8062f9
+126021 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+131150 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278477/00000000000000026234b1e446ee4aff695d86fb874578d4f0e116baa70a7af0
+131151 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+132298 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278479/0000000000000003065f32da26de1deda93eb722bf1dc4a1b787e7d68d282dbc
+132299 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+138977 [New I/O worker #3] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+139982 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278480/00000000000000019141fc5ef7f2af078c2a8340bd9b7924c46e3860811f7a2f
+139983 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+144494 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Chain download 6% done with 537 blocks to go, block date Jan 3, 2014 8:43:40 PM
+145494 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278481/00000000000000020eb97bc2775390d01243e497735ea12f6620a7a3310e3ae1
+145496 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+151338 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278482/0000000000000002b3a3aaf1afe5dc3f0b543c20bb03347d5e2ffc09f1fc34e3
+151340 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+152990 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278483/000000000000000251d8c6bb4f73d2f68e359fe143dfd3645374a4d26d09388c
+152992 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+159221 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278484/000000000000000238d73c9a721a1fbdc38c08ed1797011d17459fe62d275035
+159222 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+160599 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278485/0000000000000000122e1dbc5ade3a86d6ad32e52811ccdf5ce3c5ca72f437ce
+160601 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+172124 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278486/00000000000000010ba6426b6397347298edf260dab8a90de0384d2c672a930a
+172125 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+174203 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Chain download 7% done with 531 blocks to go, block date Jan 3, 2014 10:25:56 PM
+175204 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278487/0000000000000001537dba2ce1f76e60db366e160f052da3e15e748be45cc45e
+175205 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+177725 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278488/0000000000000002bc93b18f0e64d6f882fe93bebdae23891e8d8759922b5607
+177727 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+183422 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278489/000000000000000195d9b7f80bc006ab4eb182dc26c85a4b8b62ae4f26a4696a
+183423 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+188159 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278490/0000000000000001d52c08e2d19762d8b11103f867535197c273a4b79bbeb5af
+188161 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+193331 [New I/O worker #3] INFO  c.g.bitcoin.core.DownloadListener - Chain download 8% done with 526 blocks to go, block date Jan 3, 2014 11:02:54 PM
+193612 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278492/00000000000000008d604383ddb6aeb3775a7fde1dd321adf194545cfe32ca8e
+193613 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+199756 [New I/O worker #3] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+200761 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278493/00000000000000007488b530a2c208f8e1528b71c151a75a34d29fcfe0687c55
+200762 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+4014 [WalletAppKit STARTING] INFO  c.g.bitcoin.core.AbstractBlockChain - chain head is at height 278493:
+v2 block: 
+   previous block: 00000000000000008d604383ddb6aeb3775a7fde1dd321adf194545cfe32ca8e
+   merkle root: 9316da726143db812f9d4dbe1ca8ef5d78f20e61600591c5e709912a72bfc0d9
+   time: [1388792190] Fri Jan 03 23:36:30 UTC 2014
+   difficulty target (nBits): 419628831
+   nonce: 639044046
+
+4459 [PeerGroup STARTING] INFO  com.google.bitcoin.core.PeerGroup - Peer discovery took 354msec
+4536 [PeerGroup STARTING] INFO  com.google.bitcoin.core.Peer - [2001:8d8:840:500:0:0:39:1ae]:8333 - No route to host
+4537 [New I/O worker #2] INFO  com.google.bitcoin.core.PeerGroup - [2001:8d8:840:500:0:0:39:1ae]:8333: Peer died
+4537 [PeerGroup STARTING] INFO  com.google.bitcoin.core.Peer - [2001:788:2:117:0:0:0:204]:8333 - No route to host
+4538 [New I/O worker #3] INFO  com.google.bitcoin.core.PeerGroup - [2001:788:2:117:0:0:0:204]:8333: Peer died
+4538 [New I/O worker #2] INFO  com.google.bitcoin.core.Peer - [2001:470:c1f2:3:0:0:0:201]:8333 - No route to host
+4538 [New I/O worker #4] INFO  com.google.bitcoin.core.PeerGroup - [2001:470:c1f2:3:0:0:0:201]:8333: Peer died
+4628 [New I/O worker #6] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bitcoin.dashjr.org/68.229.166.59:8333 as: /BitCoinJ:0.10.3/
+4731 [New I/O worker #7] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bluematt.me/130.180.122.103:8333 as: /BitCoinJ:0.10.3/
+4751 [New I/O worker #6] INFO  c.g.b.core.TCPNetworkConnection - Connected to 68.229.166.59: version=70001, subVer='/Satoshi:0.8.6/', services=0x1, time=Tue Jan 07 00:50:18 UTC 2014, blocks=279024
+4765 [New I/O worker #5] INFO  c.g.b.core.TCPNetworkConnection - Announcing to seed.bitcoin.sipa.be/109.235.49.27:8333 as: /BitCoinJ:0.10.3/
+4830 [New I/O worker #6] INFO  com.google.bitcoin.core.PeerGroup - [68.229.166.59]:8333: New peer
+4831 [New I/O worker #6] INFO  com.google.bitcoin.core.PeerGroup - Setting download peer: [68.229.166.59]:8333
+4832 [New I/O worker #6] INFO  c.g.bitcoin.core.DownloadListener - Downloading block chain of size 531. 
+4921 [New I/O worker #7] INFO  com.google.bitcoin.core.PeerGroup - [130.180.122.103]:8333: Peer died
+5034 [New I/O worker #5] INFO  c.g.b.core.TCPNetworkConnection - Connected to 109.235.49.27: version=70001, subVer='/Satoshi:0.8.5/', services=0x1, time=Tue Jan 07 00:50:20 UTC 2014, blocks=279024
+5260 [New I/O worker #5] INFO  com.google.bitcoin.core.PeerGroup - [109.235.49.27]:8333: New peer
+7019 [New I/O boss #17] INFO  com.google.bitcoin.core.Peer - [101.28.51.40]:8333 - connection timed out
+7019 [New I/O worker #1] INFO  com.google.bitcoin.core.PeerGroup - [101.28.51.40]:8333: Peer died
+7020 [New I/O boss #17] INFO  com.google.bitcoin.core.Peer - [66.56.41.123]:8333 - connection timed out
+7020 [New I/O worker #8] INFO  com.google.bitcoin.core.PeerGroup - [66.56.41.123]:8333: Peer died
+7236 [New I/O worker #9] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bitcoin.dashjr.org/180.154.69.185:8333 as: /BitCoinJ:0.10.3/
+7280 [New I/O worker #10] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bluematt.me/88.192.246.174:8333 as: /BitCoinJ:0.10.3/
+7490 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278496/0000000000000002dde3b297f44eddaf45b7f69cdfb420d46cef0e8e521c5638
+7512 [New I/O worker #9] INFO  c.g.b.core.TCPNetworkConnection - Connected to 180.154.69.185: version=70001, subVer='/Satoshi:0.8.5/', services=0x1, time=Tue Jan 07 00:50:17 UTC 2014, blocks=279024
+7516 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 26msec
+7600 [New I/O worker #10] INFO  c.g.b.core.TCPNetworkConnection - Connected to 88.192.246.174: version=70001, subVer='/Satoshi:0.8.6/', services=0x1, time=Tue Jan 07 00:50:23 UTC 2014, blocks=279024
+7625 [New I/O worker #6] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+7746 [New I/O worker #9] INFO  com.google.bitcoin.core.PeerGroup - [180.154.69.185]:8333: New peer
+7746 [New I/O worker #9] INFO  com.google.bitcoin.core.PeerGroup - Unsetting download peer: [68.229.166.59]:8333
+7746 [New I/O worker #9] INFO  com.google.bitcoin.core.PeerGroup - Setting download peer: [109.235.49.27]:8333
+7746 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Downloading block chain of size 527. 
+7882 [New I/O worker #10] INFO  com.google.bitcoin.core.PeerGroup - [88.192.246.174]:8333: New peer
+8646 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278497/000000000000000181fd47a47727a6cce1ade92a77cc6a8adcb5deee15a8643e
+8648 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+14163 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278498/0000000000000002106d63408afe2d40dd8cbde271b85ce7bd8ae4760afe864b
+14164 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+15682 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278500/000000000000000142468ef10c92c7566a2f398f11b11e340d15c6aef19e1f63
+15684 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+16477 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+17480 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278502/00000000000000004865fb35fb7e7d5ce43a6feb50aa7df82a86619a5e096df5
+17482 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+18459 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+18468 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 1% done with 521 blocks to go, block date Jan 4, 2014 1:16:32 AM
+19468 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278503/00000000000000005a966a8fb6598edf89add7fc8ae6cba2933618fca5a3d53b
+19470 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+21109 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278504/000000000000000190fc419aaa15de2a41d247de433557c6f1ee7418b8433522
+21110 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+23421 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278505/00000000000000008564425aecc160fdcc168cf7aec24cfa9f8be2894aaa9507
+23422 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+25224 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278507/0000000000000001448d408f38fc39dbede11b35ef0dc4740f4864d1c2cfb5ad
+25226 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+25697 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+25698 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 2% done with 516 blocks to go, block date Jan 4, 2014 1:55:39 AM
+26699 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278510/000000000000000042936c5bf089c000484390b08812d7cec07a53b0162addca
+26700 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+27503 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+28506 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278511/00000000000000011432564b8186eebdfd04235cccf5a56574f1880108efb993
+28507 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+29048 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 3% done with 511 blocks to go, block date Jan 4, 2014 2:23:23 AM
+30047 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278514/0000000000000001edaa191557665aeecf43da67243090806c78b6a2ef15e9bb
+30048 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+32227 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+33231 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278516/00000000000000019e1c99964ef0b1a38b0040ad843214c12a58f3b7c7587fb8
+33232 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+33831 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+34835 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278518/00000000000000026dafdaa584610c842d6891fcacfc89677e447f19b49fc1a1
+34836 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+37112 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+37114 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 4% done with 505 blocks to go, block date Jan 4, 2014 3:29:09 AM
+38115 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278521/00000000000000013122305a6ab771b90f3badb2b8ccf39b9669395930acc2a6
+38116 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+38544 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+39411 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 5% done with 500 blocks to go, block date Jan 4, 2014 3:40:51 AM
+39547 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278524/00000000000000000c847412b6990c7fc61d7bea93a696988ab13b52d981cea2
+39548 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+40385 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+41388 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278525/0000000000000002a4186c5c6e983b8c9f949e5a1b09d2dacdfc3ae8b085c5e2
+41389 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+43588 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278527/000000000000000131fd056ce28cdb66ae9a2cc04b834063b26052360483e396
+43590 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+45141 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+46144 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278528/00000000000000026b449d32fa0d6ff24a91ec05ace9d3f8bf0d4212d12730bc
+46145 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+46333 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 6% done with 495 blocks to go, block date Jan 4, 2014 4:45:16 AM
+47333 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278529/000000000000000209b46f982784ef7f48635066e7a706ca2b28c4b1f5ea66c0
+47335 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+51143 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278530/0000000000000002ec9bfcf28f6ca5cedf52728fa7022d53066f36a7bf173608
+51145 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+55110 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278531/0000000000000001f26681727e510ea2d8367f22e210451694acd84280783f65
+55112 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+58509 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278533/0000000000000001033724b06ca90cd4a036632766217c39d448c477c91ded78
+58510 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+58802 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+58803 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 7% done with 490 blocks to go, block date Jan 4, 2014 6:19:38 AM
+59803 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278534/000000000000000058d5ade07621bc1c09bb0fe01ba04844a3c403a0593a98d3
+59804 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+61257 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278536/0000000000000000c7d117a7ae597543f211bc72defb038a6542ee0c58f77db2
+61259 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+66065 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+67070 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278538/00000000000000012118d6895ff0a29a74a4f68c6d236ea522df42e720a29abc
+67071 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+68676 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+69678 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278539/00000000000000003143fcb75cb9a018165a1959dfaa4c7a6089014d568da51f
+69679 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+71052 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 8% done with 484 blocks to go, block date Jan 4, 2014 8:34:32 AM
+72053 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278540/000000000000000293dce4ead626cf5eec3fa5cb92bd6a3faf213436f43a4158
+72055 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+73074 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278544/0000000000000001efbcf4665977f73042dd5c12f6b3f793d7b0ceff4580b9cf
+73076 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+73109 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+73110 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 9% done with 479 blocks to go, block date Jan 4, 2014 8:50:45 AM
+74111 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278546/0000000000000000871d169cb93e74355610f10993662fa597173cc16cb9f38a
+74112 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+75433 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+76435 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278547/0000000000000001cb50359a6a761555a4a9b9ba4dfc193b9ea7caaa0bcc2f88
+76436 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+79867 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278548/00000000000000012ed359b30d0728142cd2cb3e071e4c1fc9ad7445852ab474
+79869 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+83636 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278549/000000000000000088cebcfa2e6653b0a9eda432ae1fb9711c36cb1375f9059e
+83637 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+84005 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 10% done with 474 blocks to go, block date Jan 4, 2014 10:37:38 AM
+85006 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278551/0000000000000000627a786abe0832726cdc661e1ed31a298f6d8d7c6c609fe8
+85008 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+85035 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+85719 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 11% done with 469 blocks to go, block date Jan 4, 2014 11:03:25 AM
+86036 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278556/0000000000000001d95e1d4170f431e0295a24cea0259ebc05d98993d8a6a8c9
+86037 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+88232 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+89234 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278557/0000000000000000be4921fab20219b06639314cba2483463ef6ff87c7b8529c
+89235 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+90295 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278560/0000000000000001916faa85bc307ca096504f977a49ec4854e5cac78db89c90
+90296 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+90703 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+90704 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 12% done with 463 blocks to go, block date Jan 4, 2014 11:37:56 AM
+91704 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278564/00000000000000009df9e05cfb4b93e1e4e95f5af3cde6cb9f9e54d0f9d8a917
+91706 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+91942 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+91956 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 13% done with 458 blocks to go, block date Jan 4, 2014 11:56:13 AM
+92944 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278568/00000000000000010f506a248cb023addb43b06874f77e0e5fd78036af0ea1e5
+92945 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+93038 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+93933 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 14% done with 453 blocks to go, block date Jan 4, 2014 12:24:46 PM
+94041 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278571/0000000000000000a981eecb9a433719c6a43ee72eb10e2d9143cb75e941efec
+94043 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+94058 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+95059 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278576/00000000000000028e8c0b726ce5c7e9370fbdbd34d22e73fe173b636873f5ca
+95060 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+96517 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+96518 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 15% done with 447 blocks to go, block date Jan 4, 2014 12:55:31 PM
+97519 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278579/0000000000000002c39605667ef793ced8bc34fd184814aa50b820e6057add3b
+97520 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+99276 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+100084 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 16% done with 442 blocks to go, block date Jan 4, 2014 1:34:52 PM
+100278 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278582/0000000000000002188fae55e9f1817eadab098875573a23478f637ee88a1ed8
+100279 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+101375 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+102379 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278585/00000000000000012f0e01b271171998183f955548bf6ba7fad99ca341ccfeea
+102380 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+103383 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+103389 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 17% done with 437 blocks to go, block date Jan 4, 2014 2:20:55 PM
+104385 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278587/00000000000000021305ca3a5504fc96660f08ac4f23f56cb099c07dee099d7e
+104386 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+104992 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+105994 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278588/000000000000000259a8cc917d0a753dc6c91a4e397d629ce00b930e518fa433
+105996 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+107187 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278591/0000000000000003018b9f5ae51d411f70af6df9ac6156d023e256f775b0b697
+107188 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+109926 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+109927 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 18% done with 432 blocks to go, block date Jan 4, 2014 2:56:06 PM
+110927 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278593/0000000000000000253f582a191e88a17f642ab5fa3b4551afcb9f2e6632e8c5
+110929 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+112753 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+113755 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278594/00000000000000018d55d28d6da23f334f2f44f2a43fa58fa6eedddad816901a
+113756 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+115229 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278595/0000000000000002175c4a45b0c9d69f7c05e0c67a729b54a06e9e14bdf53b3f
+115231 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+116305 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278596/00000000000000007e1766103e4d49cc06dfac42b8e0cee5c0c435544ce8826d
+116306 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+118758 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278597/000000000000000117a974f0b875a343977fa2a72fe56eed1d30631c87ccfb28
+118759 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+119779 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 19% done with 426 blocks to go, block date Jan 4, 2014 4:02:39 PM
+120779 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278598/00000000000000000b5d9f1b8e7304088b8e7ddb4bd243479ef101b03a080b1a
+120780 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+122184 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278599/00000000000000020e1ce04f83186757239464ef3d71d5251460f949a3fe7d11
+122185 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+123226 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278601/0000000000000001fc89a18ce3e3ee36b0630f93b7685533f6a657843a7d38ad
+123227 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+125642 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+126644 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278602/00000000000000003cb73777fb51126e7e671422a683ead56a2ed4b75b50abb2
+126646 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+126993 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 20% done with 421 blocks to go, block date Jan 4, 2014 4:57:44 PM
+127994 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278603/00000000000000027de4d31a376bd71bc4f31ac5f4b9a7434e3ffc1ecf48d1e1
+127995 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+129209 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278604/000000000000000188dcd90c7a1702b679e7378ac0e3fca1c1b7f39beda38819
+129210 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+130547 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278606/0000000000000000bccd8de6ac87df88010e356075ea98515a2369566a89b47c
+130549 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+131929 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+132932 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278607/00000000000000012c6fd6321531cacfc9b663647df45e3f96f3416700693cc0
+132934 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+132951 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 21% done with 416 blocks to go, block date Jan 4, 2014 6:11:21 PM
+133952 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278608/000000000000000192c5f077e57987841140b01d0758fb5f065731d7e036efcf
+133953 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+135673 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278610/000000000000000108a7ed3268f150e73e25de4fd541bfbda6ffc59aac8d7856
+135674 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+139844 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+140848 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278611/000000000000000108ba0a5aa2b384e218c19e63fcb4f26d8092f312eeaabd03
+140850 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+141951 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278612/0000000000000000046eee0c96d835a6a275ba3c8c2607b91a9f71a04278a490
+141952 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+143940 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 22% done with 411 blocks to go, block date Jan 4, 2014 7:03:11 PM
+144941 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278613/0000000000000000c132000e2da47e369c5f6fa17d6cc626a678268af4106c42
+144943 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+146469 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278614/00000000000000003fce752ccafde7d45c25e741bd0ded09787d8a84756e3739
+146471 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+148020 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278615/00000000000000007e3af7f935131d925eea58659e6171304a4aa53d8c84d998
+148022 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+152076 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278617/000000000000000115075d7a69c34aeff118fe4e29bed0e452d2f9fdeab27a30
+152078 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+153700 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+154702 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278618/00000000000000019095e5e401738722cb34cf704658e8c5f23f0d4716a98476
+154703 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+157459 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 23% done with 405 blocks to go, block date Jan 4, 2014 9:03:04 PM
+158459 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278619/000000000000000091817642d3a3e628bf5afd198f057b17f5796239b9cd709c
+158461 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+162359 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278621/0000000000000000cfa133ff79e2bc9a7ed8eda6d21c7992e296cf5fed54551c
+162361 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+162792 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+163794 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278622/0000000000000001fe63171693741e04749e0d14a039ad93c7779cbd940ca63b
+163796 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+166238 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 24% done with 400 blocks to go, block date Jan 4, 2014 10:01:19 PM
+166250 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278624/000000000000000299abcb880bda1650d133adc0390c53aec1810daade4e02f6
+166251 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+168502 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+169505 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278625/0000000000000002cebeb9e960d4d4c13d14518a27986704aa9dd960392a3e45
+169507 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+170578 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278627/0000000000000002af233a45ebd6924c08eb759ceaa91e198dda0956a120c248
+170579 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+170685 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+171040 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 25% done with 395 blocks to go, block date Jan 4, 2014 10:46:03 PM
+171687 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278630/0000000000000001fcb9aca54fc9909326abe591692492290038fe315c0e0fcf
+171688 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+171831 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+172832 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278631/0000000000000001c471a15eeb79b938a6686c31b42095ca81ca68a9a3ee938a
+172834 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+174319 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278632/00000000000000012d165270071b7bd6735d0da74a2e8c7b2eca8f8d6bbe1560
+174320 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+176124 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278633/00000000000000001148337a157b408ac4257f19bea104a68b3f933d8a10f010
+176126 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+176644 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 26% done with 389 blocks to go, block date Jan 4, 2014 11:43:30 PM
+177634 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278636/00000000000000021c63aeec39e6fc1e15bb264b885ba0fef6fdd8b980a07fa2
+177635 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+178028 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+179030 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278638/000000000000000114834f7deb45e88f998c920fff7099c8e4d5b1560347ae6e
+179031 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+180617 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+181089 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 27% done with 384 blocks to go, block date Jan 5, 2014 12:47:08 AM
+181619 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278640/000000000000000081d57600096dadc3e2f3a8bed64d864346c12d53427e698d
+181620 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+183103 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+184104 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278641/0000000000000001477ab0d421fb3aa477f2fcde0b6e8a7ff181510378cbcff1
+184106 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+186214 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278643/000000000000000193da3d39a8fa77a68d379a5254fa0f0dc43d662f8643cbb7
+186216 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+186831 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+187833 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278644/0000000000000000b4b72fdf6edd51894d0eb11ff091e117037f217b68c9729c
+187834 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+188439 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 28% done with 379 blocks to go, block date Jan 5, 2014 1:09:04 AM
+189440 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278648/0000000000000001ff704c7957b8f5cb9b12e63f779ae04b57cd402305decedb
+189441 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+190361 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+191070 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 29% done with 374 blocks to go, block date Jan 5, 2014 1:30:35 AM
+191362 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278651/000000000000000048fd23d666b1553551b2bcaed9c2b53cc61b8d1f373cf987
+191364 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+192219 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+193222 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278653/0000000000000002e450033c60530ffe207af2b0901c38a288224371ab041d79
+193223 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+193599 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+194601 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278655/000000000000000035a066db0a1cce1d276d8e4a70fe21b29440b161214cb01f
+194602 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+194604 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+194605 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 30% done with 368 blocks to go, block date Jan 5, 2014 2:16:07 AM
+195606 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278658/0000000000000002ffad802130f0099f2671848e811d5ee9df61f04c2b08405b
+195608 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+196544 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+197274 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 31% done with 363 blocks to go, block date Jan 5, 2014 2:51:09 AM
+197545 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278661/0000000000000000c5c9e1e886d6a1fa3a63c3b0218314e9c2d9f26ae1c18ba7
+197547 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+199927 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+200930 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278664/0000000000000000c08036d972e03d65f9070d5675e14edd6fb77e81947e0c34
+200931 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+202852 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+203400 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 32% done with 358 blocks to go, block date Jan 5, 2014 3:47:42 AM
+203854 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278667/0000000000000001da385660f04fd25a780f99ac4f4607b3551945ef12d979b3
+203855 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+203923 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+204924 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278669/0000000000000002449d280104ec9d525ccf2cf99604e1c055d93c9e9bb786b4
+204926 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+205701 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+206704 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278670/0000000000000001aeafc81608aff858626f09c4a01ac163ead4bea0f5449b10
+206706 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+206796 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 33% done with 353 blocks to go, block date Jan 5, 2014 4:13:17 AM
+207797 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278672/00000000000000002ce1b437663f90b836c8e46a223ff29aed54818120cf848a
+207798 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+209569 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+210571 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278673/0000000000000000f22c5d5dce4e3775414f05974902f763242cafe9bb8c17e4
+210572 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+212163 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278674/000000000000000099254d63d4c993c5204eb048e5e0e14a52b976bd88ae56ab
+212164 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+213494 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278676/0000000000000001d1a271a490916308c772fd4a115e5cf5a27e5c336835ffba
+213495 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+215425 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+215425 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 34% done with 347 blocks to go, block date Jan 5, 2014 5:15:06 AM
+216426 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278679/00000000000000015bedaa39f0c8974b781e6f8bbd7a38f577129499ee8146ca
+216428 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+217415 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+218418 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278680/0000000000000001f41111e9185ca4b4da33286bd6aa11de6a78ce7d4df7ef75
+218419 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+219924 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 35% done with 342 blocks to go, block date Jan 5, 2014 5:37:01 AM
+220698 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278684/0000000000000000eb66b7a1259a08dfdbf94b99f6ceb2b630df2d4f536cbfe6
+220700 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+221103 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+222105 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278686/00000000000000023f333e897d2eb57e8aed8e2e9095c0e4b2720d86492fe9f7
+222106 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+222760 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+222761 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 36% done with 337 blocks to go, block date Jan 5, 2014 5:59:11 AM
+223762 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278688/0000000000000000c9fbd7e87b3228b7f08dfacb4995bb82efd86e6b6d0d80f4
+223763 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+225960 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+226963 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278690/0000000000000001657a7866be99cc8bb6d6160f07d0a3bdea4ac7dad40d1f44
+226964 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+227214 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+227661 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 37% done with 332 blocks to go, block date Jan 5, 2014 6:39:25 AM
+228216 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278693/0000000000000002861ee0919fc86990573ac360820766dc1b9ba580e5ccf7b6
+228218 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+228456 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+229458 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278695/0000000000000001a9b1548aaf26419c4fc4290d191052dc7927e01b9937401e
+229460 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+230138 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+231140 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278696/00000000000000006424a4e0bc19626c555a9a46b6456d68e3204c5de7cb40f7
+231141 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+232561 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 38% done with 326 blocks to go, block date Jan 5, 2014 7:30:37 AM
+232692 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278698/00000000000000027e9f38b17b551757ad44ab773f5e347739922fac4434e3b2
+232693 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+232876 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+233877 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278701/0000000000000001c11c498a1836dbc759fb0ade9fc0a2ff801ebf7a9791f87c
+233878 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+234143 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+234144 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 39% done with 321 blocks to go, block date Jan 5, 2014 8:14:14 AM
+234991 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 40% done with 316 blocks to go, block date Jan 5, 2014 8:38:52 AM
+235145 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278708/0000000000000000a7a14e2f813217e95a1007ff3a83c5ca2185d73b4c660272
+235147 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+235209 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 7 blocks per second
+235767 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 41% done with 310 blocks to go, block date Jan 5, 2014 9:07:42 AM
+236211 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278716/000000000000000086cb05d2523c0bc8aad04f017644ef92483ecc5da278e00a
+236212 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+237712 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 8 blocks per second
+238713 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278718/000000000000000018776b3b7618fc9e8877e4844565f5a366a7b0cc3c892df2
+238715 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+238868 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+238869 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 42% done with 305 blocks to go, block date Jan 5, 2014 9:48:20 AM
+239870 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278721/0000000000000000a812bc963db69d83384241e2fc85b7b9ab9c4c868997109a
+239871 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+240975 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+241464 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 43% done with 300 blocks to go, block date Jan 5, 2014 10:26:34 AM
+241978 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278727/00000000000000003a329fe533b4bfe9558d15df710a4e4b70af3c5feecf2d34
+241979 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+242013 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 6 blocks per second
+242233 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 44% done with 295 blocks to go, block date Jan 5, 2014 10:59:13 AM
+243015 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278732/000000000000000224ed9a8610d8e30272ca6861cc47695ce859d63ec9f8e9f7
+243017 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+243168 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+243361 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 45% done with 289 blocks to go, block date Jan 5, 2014 11:32:53 AM
+244170 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278738/00000000000000019d71cf51166ef80efdaa718c73b3b440370d4adfeaf26fef
+244172 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+244303 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 6 blocks per second
+244537 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 46% done with 284 blocks to go, block date Jan 5, 2014 12:16:39 PM
+245158 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 47% done with 279 blocks to go, block date Jan 5, 2014 12:36:07 PM
+245305 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278745/0000000000000000d5147dc64157d6c92f6de6ccb34c894011dc0aa2a42510d5
+245306 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+245554 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 7 blocks per second
+246555 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278747/0000000000000002c6437a58f38c313ce55db3d36b342b235f25a58b5fa2667e
+246557 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+247307 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+248309 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278748/00000000000000024fc17995596fccb9613c3af6ebf0f63cc01937c06b85ae7f
+248311 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+250352 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 48% done with 274 blocks to go, block date Jan 5, 2014 1:53:19 PM
+250645 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278751/00000000000000019b727f927167bd3a5f55237a17f4c02b5326b5e1fdf8d5da
+250647 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+250737 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+251739 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278755/00000000000000004950396a8d217e6be722ee8e94b36c960ed4caa33793b6f5
+251740 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+252667 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+252669 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 49% done with 268 blocks to go, block date Jan 5, 2014 2:34:08 PM
+253669 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278760/0000000000000000bd07ef04578dc4673c822bdd4170f58a486f00798d6ddb69
+253671 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+254015 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+254016 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 50% done with 263 blocks to go, block date Jan 5, 2014 2:57:57 PM
+255017 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278765/000000000000000303857f84fdb649dff375c83516aedd4e3111b0b684056935
+255018 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+255504 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+255506 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 51% done with 258 blocks to go, block date Jan 5, 2014 3:38:08 PM
+256506 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278767/00000000000000012f21305d7cb927301243a9ae2d921fe4d4155ea59e8e2ce5
+256507 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+256744 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+257747 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278770/000000000000000168256fe207b62c8d14bb31f98327c35bd8f19236f5efdc93
+257748 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+258110 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+259009 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 52% done with 252 blocks to go, block date Jan 5, 2014 4:32:01 PM
+259113 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278773/00000000000000028470e1f73211cbcbc0b7a00e35989f7f3e1504483ca3a2a7
+259114 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+259226 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+260228 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278776/000000000000000264dfb00229cb6c2d5e1b2ae59059a2c51a6c8cf9dcf2aa5d
+260229 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+260524 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+260526 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 53% done with 247 blocks to go, block date Jan 5, 2014 5:02:44 PM
+261526 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278781/0000000000000001fc1681e84a7161e86f15c357076278e0d613ec150dc2f29d
+261527 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+261608 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+261609 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 54% done with 242 blocks to go, block date Jan 5, 2014 5:23:18 PM
+262610 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278783/0000000000000002b412ccf96225b5da1eb8fd124e896fe1a5cdbed19d351fd6
+262611 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+262690 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+263691 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278786/00000000000000002a5f00fca1a57753fdd4f1edc9472e2397c8f0c24a3de6b7
+263693 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+264792 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+264793 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 55% done with 237 blocks to go, block date Jan 5, 2014 5:54:01 PM
+265794 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278788/0000000000000000794d06f7ac135e2c4a538aae22e8313435ae9fd30a4e6c63
+265796 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+266842 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+267845 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278789/00000000000000020ad14ddbbe1eb61f02d994a50d735bd4b9ea975779025cf3
+267846 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+268753 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 56% done with 231 blocks to go, block date Jan 5, 2014 6:32:23 PM
+268962 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278794/000000000000000058be94b2b17fca1888fee4192e8b7f7ebce68a38d0845d7d
+268964 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+269183 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+270185 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278797/0000000000000001faa375191f6acc9a5f08798f55a5f0567539409955bc98d3
+270186 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+270502 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+270503 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 57% done with 226 blocks to go, block date Jan 5, 2014 7:06:55 PM
+271504 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278800/0000000000000002f3685ae01c53c0dee722e411fc97343d99d3dd3569b95516
+271505 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+271818 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+272821 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278801/0000000000000000ae2073d9f5379922f2fa6f6930ac242002f19b083abaa7f3
+272822 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+275996 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278802/00000000000000021eabb73332af8e75fa83e330de5a673e0e75655beae9e591
+275997 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+276533 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 58% done with 221 blocks to go, block date Jan 5, 2014 8:14:55 PM
+277534 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278804/00000000000000008090abc1c03f9611ad26bf24fbe7410224b3bb5c1bf82bc4
+277535 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+277715 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+278554 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 59% done with 216 blocks to go, block date Jan 5, 2014 9:02:55 PM
+278718 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278808/0000000000000002efa0bb8e827dd32147f5ce5256d17296387c445be469e219
+278719 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+279057 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+280060 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278810/000000000000000247f8cf2392f15fdb98f1b6658b794d77d9afdc0a01b5fca7
+280061 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+280122 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+281125 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278812/0000000000000002ae40257d0d7975cf0e49743dfefdf74d8ba6593066837f1a
+281126 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+281495 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+281547 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 60% done with 210 blocks to go, block date Jan 5, 2014 10:10:07 PM
+282497 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278815/00000000000000022b2727d80864cc4aa0b0cacdc85cf709f0df862c7373fecc
+282498 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+282712 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+283714 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278817/000000000000000162f3fe085f2ab53cbbd6770b2bea7a55265d199a23276490
+283716 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+285147 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+286149 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278818/0000000000000002d2fabecd507916a97a7fb46c7ceab970e423f2a5e7acc502
+286151 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+286869 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 61% done with 205 blocks to go, block date Jan 5, 2014 10:53:13 PM
+287869 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278821/0000000000000002126f30bdab0ec3a3c8b23bf555acb22ccb32a912fb5fe66b
+287871 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+287927 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+288547 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 62% done with 200 blocks to go, block date Jan 5, 2014 11:10:37 PM
+288929 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278824/0000000000000000eaa79ae869861a6ee453b3bd041ccd686782deb7db87eb62
+288930 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+289114 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+290116 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278827/0000000000000002fa2c43772f34ab3284803255fef5354755fa1568d66e4996
+290118 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+290483 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+291023 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 63% done with 194 blocks to go, block date Jan 6, 2014 12:09:40 AM
+291486 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278832/0000000000000002343f7194619ad28b65073d658b22d3a39a3a725886931b03
+291487 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+291684 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+292686 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278834/00000000000000002f1003d49eab457bf34f984880d59cde4c7bc6bc284c2df2
+292687 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+293499 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+293500 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 64% done with 189 blocks to go, block date Jan 6, 2014 12:22:46 AM
+294501 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278837/00000000000000016f569b32d29a04933f8830b2110e5d4c64e32903a34db169
+294502 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+294901 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+295902 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278839/0000000000000001c221c3bae7f8784892a2115c33f5a1ff1991c8bf4c43e93f
+295904 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+296478 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+296479 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 65% done with 184 blocks to go, block date Jan 6, 2014 12:45:01 AM
+297480 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278842/00000000000000027c1dbeaf61720af4b9d0aa48e14653812e9eb6d0a7289ae4
+297481 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+297602 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+298535 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 66% done with 179 blocks to go, block date Jan 6, 2014 1:17:37 AM
+298604 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278845/0000000000000000bd83869823ce3d491b35fa374576d7e45be3e22e2990c045
+298605 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+298696 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+299697 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278850/0000000000000001d2e5f5ccfb0b59c1b1efc1146f27202fc0865ae2caa12b0b
+299698 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+299982 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+299983 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 67% done with 173 blocks to go, block date Jan 6, 2014 1:45:02 AM
+300983 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278852/000000000000000251064b46952ef2f341712c26f8e9369235ce6b4add149ea3
+300985 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+302452 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+302457 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 68% done with 168 blocks to go, block date Jan 6, 2014 2:39:48 AM
+303453 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278856/0000000000000002580118f6d6872bf25643fba8431e49f0c203d7a9b107d124
+303455 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+304488 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+305490 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278857/0000000000000001512191e8dec7c873430301cddd9899781dbcfbd7398d866e
+305491 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+306625 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278860/000000000000000027ee13e8ff31f4f4fdd3edc71c58a2e3bfa76478f9efeeb4
+306627 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+306649 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+306650 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 69% done with 163 blocks to go, block date Jan 6, 2014 2:52:35 AM
+307650 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278864/0000000000000001cfaa5555ab19a4ec2d4fb03ad0e8b08b52b87a567464d4b8
+307651 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+307870 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+308292 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 70% done with 158 blocks to go, block date Jan 6, 2014 3:37:07 AM
+308871 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278867/00000000000000025dd61d9aba1de3d45f0fb3745c628f3db8bb54144b50505b
+308873 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+309562 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+310565 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278869/0000000000000000e5afc93631c47fdcaf5849810d2da1e03026efba09ce90d6
+310566 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+311680 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+312687 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278870/000000000000000176de225544cc6c575becd7ddcf8199473db7440df1b44d2c
+312688 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 0msec
+314976 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 71% done with 152 blocks to go, block date Jan 6, 2014 5:08:15 AM
+315243 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278872/0000000000000001190bee8a28992bd9363b647035bc34524125295aa782149a
+315244 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+315457 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+316459 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278876/00000000000000009ee09e5fe8847229caf898cae2663472662c067b244e264d
+316460 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+316539 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+316539 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 72% done with 147 blocks to go, block date Jan 6, 2014 5:14:26 AM
+317540 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278881/0000000000000000020d6cfaf63d3e86d5da310ceaed01b544c427b4ca7c1ce0
+317542 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+317610 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+317611 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 73% done with 142 blocks to go, block date Jan 6, 2014 5:37:30 AM
+318611 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278884/00000000000000027ed893f65febf49db049e17946c62e54403610cab7b5f014
+318613 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+318738 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+319503 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 74% done with 137 blocks to go, block date Jan 6, 2014 6:33:27 AM
+319740 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278887/000000000000000103996844aeea6f397022d9d8b63ac9d7ec8d8e1a9e0096e1
+319741 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+319892 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+320895 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278888/0000000000000001e2752327c5b420632b9584066f1b659fd98eb0cae77cb4d4
+320896 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+322742 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278889/00000000000000020e984cc10105a378b5f840b65d45d7c340cb037b1ecc28db
+322743 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+325144 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 75% done with 131 blocks to go, block date Jan 6, 2014 7:41:27 AM
+325290 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278893/0000000000000002d0f571327e21f9097787e883c10b0097c1e6f207d69f6d48
+325292 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+325323 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+326325 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278896/00000000000000022165767bc3e9d0dc77f9e68b8e82d7bcbfc0dc5b1d8d7ebc
+326327 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+328404 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+328872 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 76% done with 126 blocks to go, block date Jan 6, 2014 8:46:17 AM
+329407 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278898/0000000000000000f75b46c09be6727b0ed2ab874d8af9486b016b1dbbcdde6e
+329409 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+330355 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+331357 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278900/0000000000000002e38233adbd81ab5bfc7561c769dc4aa1ac054df9090f6506
+331359 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+332702 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+333705 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278902/000000000000000226e7fe565a4d03b21900f25d6aa92360bb1980c1bf7a47d4
+333707 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+333838 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+333839 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 77% done with 121 blocks to go, block date Jan 6, 2014 9:46:27 AM
+334840 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278906/000000000000000262f2493c74260706f31dd7c9a3d062288cb4fe052b862ea7
+334841 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+335353 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+335897 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 78% done with 115 blocks to go, block date Jan 6, 2014 10:20:12 AM
+336356 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278910/00000000000000005eaa689396f916c42f884a8c73e2c67e49fae5932cc9826f
+336358 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+336565 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+337568 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278911/00000000000000030200c36802955af26ce5560ff57ed40c50cbb90b493a8977
+337569 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+341214 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 79% done with 110 blocks to go, block date Jan 6, 2014 11:00:28 AM
+341810 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278914/0000000000000000ef9ccffa44ac5075d404464bd3e985cb7878e3c693f4e842
+341811 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+341811 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+342812 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278916/0000000000000001627c58c65ad9fc3a443e3380e033167c695e6d3f926de776
+342814 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+342980 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+343851 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 80% done with 105 blocks to go, block date Jan 6, 2014 11:45:26 AM
+343983 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278919/000000000000000289cf2cc408f17a4dc82331d3e53503d81cbe3dd56a82e00f
+343985 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+344208 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+345211 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278922/00000000000000029927f22c21fd0f5537fda216034c732e9c7255f4a9d0486a
+345212 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+345403 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+346039 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 81% done with 100 blocks to go, block date Jan 6, 2014 12:34:25 PM
+346405 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278924/000000000000000015d16e0f4e3e19e346aca576f2dabbb15d07253279276ade
+346406 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+346431 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+347433 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278925/000000000000000237685aa4f4e8b5f8d4c4e760d93208b2be621479e9013230
+347435 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+349407 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278927/00000000000000005a3ce0a5277b28a40ca22f5ad63a4936e93885aaa84dc313
+349409 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+350707 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+351710 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278929/0000000000000000831bfd3c356edea1263e1bf6aaa4e363a83df74c8b23dc0d
+351712 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+351728 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+351730 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 82% done with 94 blocks to go, block date Jan 6, 2014 1:27:02 PM
+352730 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278932/0000000000000002e96846802c5b35b031f38589e23493270edcf8aa4a8e09ff
+352731 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+352903 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+353182 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 83% done with 89 blocks to go, block date Jan 6, 2014 1:42:59 PM
+353906 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278937/0000000000000001bb52bff955fb5ce3d20e047dbe3884b94a7420a0c8b5462f
+353907 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+353967 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 5 blocks per second
+354401 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 84% done with 84 blocks to go, block date Jan 6, 2014 2:07:43 PM
+354968 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278941/000000000000000088ceb1558cbc516a91e2a25d4672b2daa809bc14c3b58fd1
+354970 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+355205 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 4 blocks per second
+356207 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278943/000000000000000109e09cb569d9b41b88840bbda485228eaa1cc14e8ef99323
+356209 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+356341 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+356487 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 85% done with 79 blocks to go, block date Jan 6, 2014 3:05:27 PM
+357343 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278945/0000000000000001c5ba407f9e16f877abdc39e428d461e668077956f8c89db4
+357344 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+359073 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+360077 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278946/00000000000000002f7f54dd569df69c6acf1a10690d9b93b291bbbabfe69212
+360078 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+361483 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278949/00000000000000028abf2fc8644191196bfffe789f5c9854ffdc87d4f731c1a1
+361484 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+361711 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+362441 [New I/O worker #6] INFO  com.google.bitcoin.core.Peer - [68.229.166.59]:8333 - Operation timed out
+362459 [New I/O worker #6] INFO  com.google.bitcoin.core.Peer - [68.229.166.59]:8333 - Socket is disconnected
+362460 [New I/O worker #6] INFO  com.google.bitcoin.core.PeerGroup - [68.229.166.59]:8333: Peer died
+362589 [New I/O worker #5] INFO  c.g.bitcoin.core.DownloadListener - Chain download 86% done with 73 blocks to go, block date Jan 6, 2014 3:55:00 PM
+362633 [New I/O worker #11] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bitcoin.dashjr.org/192.0.143.26:8333 as: /BitCoinJ:0.10.3/
+362713 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278951/0000000000000002a4f7b442e7464baefde66b1c2adf22670c5530f001c4039d
+362714 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+362838 [New I/O worker #5] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+363605 [New I/O worker #11] INFO  c.g.b.core.TCPNetworkConnection - Connected to 192.0.143.26: version=70001, subVer='/Satoshi:0.8.3/', services=0x1, time=Tue Jan 07 00:55:33 UTC 2014, blocks=279025
+363746 [New I/O worker #11] INFO  com.google.bitcoin.core.PeerGroup - [192.0.143.26]:8333: New peer
+363747 [New I/O worker #11] INFO  com.google.bitcoin.core.PeerGroup - Unsetting download peer: [109.235.49.27]:8333
+363747 [New I/O worker #11] INFO  com.google.bitcoin.core.PeerGroup - Setting download peer: [180.154.69.185]:8333
+363747 [New I/O worker #11] INFO  c.g.bitcoin.core.DownloadListener - Downloading block chain of size 71. 
+363840 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278954/000000000000000260cb9281929e4ac48bb06ba2a4a9206f32aee058eebe34a9
+363842 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+375458 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 3 blocks per second
+375460 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 2% done with 69 blocks to go, block date Jan 6, 2014 4:44:16 PM
+376461 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278955/0000000000000002187764739ec539352101f8b923da3aab2a2938bd8af5c359
+376463 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+398218 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 4% done with 68 blocks to go, block date Jan 6, 2014 4:46:16 PM
+399218 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278956/0000000000000001d8b6259a52fd4b77188209f972e2a3d525887b30925c2ed2
+399220 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+404946 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 5% done with 67 blocks to go, block date Jan 6, 2014 5:02:05 PM
+405946 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278957/00000000000000004ecb9e17fc336ffd8d1fdd1c074a2e6c69d023c68f0aa3bb
+405947 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+412385 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 7% done with 66 blocks to go, block date Jan 6, 2014 5:16:38 PM
+413386 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278958/0000000000000000ed8a5f31656bafca5d17254dd99d8226ccbfc1a06d96d1e5
+413387 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+424819 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 8% done with 65 blocks to go, block date Jan 6, 2014 5:21:21 PM
+425819 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278959/0000000000000000f7d7b35dbc3d750166fe3b9c45e24a25dbed93fb4a28bf2f
+425820 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+436586 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 9% done with 64 blocks to go, block date Jan 6, 2014 5:42:08 PM
+437587 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278960/000000000000000009bc28e08b41a74801c5878bf87978c2486aee7ed8a85778
+437588 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+441930 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 11% done with 63 blocks to go, block date Jan 6, 2014 5:53:50 PM
+442931 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278961/00000000000000022b2fb9ef3011b88d9195b6ca967c9bf1b0391b3cb2abd71f
+442932 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+456939 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 12% done with 62 blocks to go, block date Jan 6, 2014 6:02:35 PM
+457939 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278962/00000000000000019cc5b7a9342bd1bf9a5585c991a56d9209c8652ac0c9ebff
+457941 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+467171 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 14% done with 61 blocks to go, block date Jan 6, 2014 6:03:14 PM
+468144 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 15% done with 60 blocks to go, block date Jan 6, 2014 6:08:05 PM
+468172 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278964/00000000000000013acf6d75dc32ccd89eeddb9552dda922790d7c286a85bf6c
+468174 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+472323 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+472324 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 16% done with 59 blocks to go, block date Jan 6, 2014 6:07:26 PM
+473133 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 18% done with 58 blocks to go, block date Jan 6, 2014 6:15:11 PM
+473324 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278966/000000000000000230411a2ab42f20a5b88475a32e4f66562d7ca7c6aac6e290
+473326 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+478526 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+478528 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 19% done with 57 blocks to go, block date Jan 6, 2014 6:16:30 PM
+479082 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 21% done with 56 blocks to go, block date Jan 6, 2014 6:23:39 PM
+479528 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278968/0000000000000002ca3fc10062bd5dae6f3c3878f755c352816e6963eba3172d
+479530 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+489121 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+489128 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 22% done with 55 blocks to go, block date Jan 6, 2014 6:32:50 PM
+490129 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278969/0000000000000002dc17e4d68331dbedbf22b24b5b6b0938c52dc1194940d623
+490130 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+497796 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 23% done with 54 blocks to go, block date Jan 6, 2014 6:49:38 PM
+498796 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278970/00000000000000006aa90ee1d0d7dc990e7a29d4656e73524408d33701e3d1e6
+498797 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+506304 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 25% done with 53 blocks to go, block date Jan 6, 2014 6:58:00 PM
+507305 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278971/00000000000000016a629480625dcf085a0f08e6ee3ffe2bb42044044f539f23
+507308 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 3msec
+512972 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 26% done with 52 blocks to go, block date Jan 6, 2014 6:59:20 PM
+513972 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278972/000000000000000141266b26e48de40c8d9f63de5805a615f7bf841e6b2c1982
+513974 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+517492 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 28% done with 51 blocks to go, block date Jan 6, 2014 7:04:22 PM
+518492 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278973/00000000000000012096d6e707222dfeef093c4907729bae167f6751fbe36dc0
+518494 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+524653 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 29% done with 50 blocks to go, block date Jan 6, 2014 7:15:45 PM
+525653 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278974/00000000000000014657fd86b72b2c5f9cf24dcb98c63075fd0ef5dbafd63f9b
+525655 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+531139 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 30% done with 49 blocks to go, block date Jan 6, 2014 7:29:58 PM
+532139 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278975/0000000000000001c0340e88bfa23ad8ec787944050bc404d87250aa4c2f2fa0
+532141 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+537591 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 32% done with 48 blocks to go, block date Jan 6, 2014 7:41:35 PM
+538592 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278976/000000000000000140460b26943c555f6529a419a6f74f3c569295e8c9c2e5d0
+538593 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+545306 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 33% done with 47 blocks to go, block date Jan 6, 2014 7:54:30 PM
+546306 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278977/0000000000000000cc803b291bdc02bb4468d3a5ed9a62d9be486607c1574a7c
+546307 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+557251 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 35% done with 46 blocks to go, block date Jan 6, 2014 7:54:44 PM
+558252 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278978/000000000000000230293d2d21057a291856b0081d66621ac2942cf46a9efff0
+558253 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+562962 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 36% done with 45 blocks to go, block date Jan 6, 2014 8:00:21 PM
+563963 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278979/0000000000000000bcee4124d5d1fe02878ff6683f388da686120211f269ed48
+563964 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+564730 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 38% done with 44 blocks to go, block date Jan 6, 2014 8:02:53 PM
+565731 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278980/000000000000000055303b99e4cc89835e28de3418e7ff3370b0f71b4e111a43
+565732 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+568783 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 39% done with 43 blocks to go, block date Jan 6, 2014 8:05:18 PM
+569783 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278981/0000000000000000d401d60b47aadf7b306f694c26d2857b618e6edafc323310
+569784 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+576903 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 40% done with 42 blocks to go, block date Jan 6, 2014 8:18:35 PM
+577903 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278982/00000000000000027038af8a0fb1d73d16618f400e06f33fd21f084aa9e73d53
+577905 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+606058 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 42% done with 41 blocks to go, block date Jan 6, 2014 8:58:32 PM
+607058 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278983/00000000000000011f83e5f9113ae66e8bc01155ee01ce95917a9930243b5d27
+607060 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+613405 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 43% done with 40 blocks to go, block date Jan 6, 2014 9:04:44 PM
+614406 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278984/00000000000000013b02ebb1900dd13a29cbd61648d5474c343c79d037649eca
+614408 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+616366 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 45% done with 39 blocks to go, block date Jan 6, 2014 9:07:48 PM
+617367 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278985/000000000000000293f30efe4d9ca305aa82faf748f58aded519698b90334426
+617368 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+622230 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 46% done with 38 blocks to go, block date Jan 6, 2014 9:12:57 PM
+623231 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278986/000000000000000011e46632600705915cfb6c7f975642f010152907ff1ecc43
+623232 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+627964 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 47% done with 37 blocks to go, block date Jan 6, 2014 9:23:08 PM
+628965 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278987/00000000000000025f3269b0e9c90feadca73aff40041361dc69d8560712bc74
+628967 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+632075 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 49% done with 36 blocks to go, block date Jan 6, 2014 9:29:22 PM
+633076 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278988/0000000000000002ffaf8fb43956b46e603d838abe67d2bbcb746298df094539
+633077 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+634846 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 50% done with 35 blocks to go, block date Jan 6, 2014 9:33:14 PM
+635846 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278989/00000000000000024e092083b89dad89d3d0eabc360c387ffbeda2465b3eb99c
+635847 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+640201 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 52% done with 34 blocks to go, block date Jan 6, 2014 9:37:22 PM
+641202 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278990/0000000000000001f315bfda4486f8436211f69e5f8f85909b2a85b5e0a0649d
+641204 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+644380 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 53% done with 33 blocks to go, block date Jan 6, 2014 9:41:44 PM
+645381 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278991/0000000000000001c6fef9a18263119c9507bd422e32b28c299f1d001b70c02d
+645383 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+645975 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 54% done with 32 blocks to go, block date Jan 6, 2014 9:43:09 PM
+646976 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278992/0000000000000000ccbc7917f9d15e1bd40c7ab3a4b2f93c364e899a9d275503
+646977 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+649875 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 56% done with 31 blocks to go, block date Jan 6, 2014 9:47:36 PM
+650875 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278993/00000000000000003e7aaa484b892a6d53953e4037b950c0e400a453f37c5d19
+650877 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+656953 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 57% done with 30 blocks to go, block date Jan 6, 2014 9:55:46 PM
+657953 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278994/00000000000000005581b5aaf924359e4e7d7df2ca6ff478535432fecd9706c4
+657955 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+670665 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 59% done with 29 blocks to go, block date Jan 6, 2014 9:58:40 PM
+671666 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278995/000000000000000173c16085a6271b65acd94b135eede4f604a79ec56bbb2ea4
+671668 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+676692 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 60% done with 28 blocks to go, block date Jan 6, 2014 10:10:00 PM
+677693 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278996/000000000000000039b01aebff23050a58d6c89591737b2e2a0261a445fd7d73
+677694 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+679675 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 61% done with 27 blocks to go, block date Jan 6, 2014 10:10:47 PM
+680675 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278997/000000000000000096dcdba5c931f66dbd4a48c3a91340ede73b173ca93fd98b
+680677 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+690187 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 63% done with 26 blocks to go, block date Jan 6, 2014 10:15:15 PM
+691188 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278998/0000000000000001b77f9839212c454d54b9ad433181631b15f1be36825d114f
+691189 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+694212 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 64% done with 25 blocks to go, block date Jan 6, 2014 10:15:38 PM
+695212 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 278999/0000000000000001ed51db67f98e83ac76209fe00dabc2a42c80cbc9a4ef6c45
+695214 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+700653 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 66% done with 24 blocks to go, block date Jan 6, 2014 10:31:11 PM
+701653 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279000/0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40
+701655 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+704514 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 67% done with 23 blocks to go, block date Jan 6, 2014 10:40:39 PM
+705194 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 69% done with 22 blocks to go, block date Jan 6, 2014 10:40:21 PM
+705515 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279002/0000000000000001ce248f7b081d3e28d83113ad1d87231b668968e93061f164
+705516 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+706814 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+706814 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 70% done with 21 blocks to go, block date Jan 6, 2014 10:41:39 PM
+707814 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279003/000000000000000120748800f911969d83f7c239764b0189cc7223b282069f16
+707816 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+713318 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 71% done with 20 blocks to go, block date Jan 6, 2014 10:43:30 PM
+714318 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279004/0000000000000001ead408bdc15dd1175281154ba7bf11c802ce3e4bee0584b4
+714320 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+715363 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 73% done with 19 blocks to go, block date Jan 6, 2014 10:46:52 PM
+716363 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279005/0000000000000002325173908a8ed61f96b20ad6a002444342bb7fe183e423df
+716365 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+721805 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 74% done with 18 blocks to go, block date Jan 6, 2014 11:09:22 PM
+722805 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279006/0000000000000002d4d7978986e518042bbeae2efee83fa8502b0f6af1de720b
+722807 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+726706 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 76% done with 17 blocks to go, block date Jan 6, 2014 11:10:56 PM
+727707 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279007/0000000000000002e6f7d49b7519e452146e2d79d08e78d18c33b0ed5374b4f9
+727708 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+731863 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 77% done with 16 blocks to go, block date Jan 6, 2014 11:18:18 PM
+732223 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 78% done with 15 blocks to go, block date Jan 6, 2014 11:18:34 PM
+732863 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279009/000000000000000147a162b6a408870f53aef73f1ea1e5871fd949a1e619b86c
+732864 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+733354 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+733354 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 80% done with 14 blocks to go, block date Jan 6, 2014 11:19:41 PM
+734354 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279010/00000000000000011f6fec68d101a6113abfaf707be7f3c5a472c6f442e9fc4e
+734356 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+738194 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 81% done with 13 blocks to go, block date Jan 6, 2014 11:22:47 PM
+739195 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279011/0000000000000002b88f6a3d9534181d0e2f5ffb67fc08e7a5fb792b448159f2
+739197 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+740605 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 83% done with 12 blocks to go, block date Jan 6, 2014 11:25:25 PM
+741415 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 84% done with 11 blocks to go, block date Jan 6, 2014 11:28:23 PM
+741606 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279013/0000000000000000386fb6e0f3b250eebc22128ef10cf91501bc6c091633c8e1
+741607 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+746594 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+746595 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 85% done with 10 blocks to go, block date Jan 6, 2014 11:36:52 PM
+747596 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279014/0000000000000001f2e29ecc811b8f595a490ec895731f8bbf2ba9c3772cf581
+747598 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+748725 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 87% done with 9 blocks to go, block date Jan 6, 2014 11:35:34 PM
+749726 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279015/0000000000000002d82dcabe235be8fb2232692233666f1e3a26a04fbcb35003
+749727 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+764078 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 88% done with 8 blocks to go, block date Jan 7, 2014 12:15:30 AM
+765078 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279016/0000000000000000977e56d6c0997d54b1b83c4e5bde4b5fccbe2098b4db4e00
+765080 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+773899 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 90% done with 7 blocks to go, block date Jan 7, 2014 12:20:02 AM
+774899 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279017/0000000000000002337caa7a38f06c8bdf4556a7d50adc5ea36abf70df1fbfa0
+774902 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 3msec
+781486 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 91% done with 6 blocks to go, block date Jan 7, 2014 12:28:41 AM
+782487 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279018/00000000000000008f5dbcabd5b7b1c74261cbba236ce99c501f87b49d84fc38
+782488 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+784916 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 92% done with 5 blocks to go, block date Jan 7, 2014 12:34:34 AM
+785430 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 94% done with 4 blocks to go, block date Jan 7, 2014 12:36:59 AM
+785917 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279020/00000000000000022a6b54ad27ed1386c8aceb479d5624222bc61995e52c92b4
+785919 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+788881 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+788882 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 95% done with 3 blocks to go, block date Jan 7, 2014 12:38:27 AM
+789633 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 97% done with 2 blocks to go, block date Jan 7, 2014 12:39:57 AM
+789882 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279022/000000000000000180bf65de40f02c779f46cdad55a1abb52b5790f598061725
+789884 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+794446 [New I/O worker #9] INFO  c.g.bitcoin.core.AbstractBlockChain - 2 blocks per second
+794447 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 98% done with 1 blocks to go, block date Jan 7, 2014 12:45:02 AM
+795448 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279023/00000000000000015691d330e6a19199dfd5e72dba1961a9e53563b695337e75
+795449 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 1msec
+796150 [New I/O worker #9] INFO  c.g.bitcoin.core.DownloadListener - Chain download 100% done with 0 blocks to go, block date Jan 7, 2014 12:45:57 AM
+797151 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279024/00000000000000009f36f19da29808850747b00bd4149f145712ab87d2717b16
+797153 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 2msec
+798712 [New I/O worker #9] WARN  c.g.bitcoin.core.AbstractBlockChain - Block does not connect: 000000000000000237cd23d88ed708dcfa3146c94ee9d5463bc52807ca8aebc7 prev 000000000000000261c68327edfc28c36f6137378157769a203b97ccba8bc4ea
+1360879 [New I/O worker #11] INFO  com.google.bitcoin.core.Peer - [192.0.143.26]:8333 - Socket is disconnected
+1360879 [New I/O worker #9] INFO  com.google.bitcoin.core.Peer - [180.154.69.185]:8333 - Socket is disconnected
+1360879 [New I/O worker #10] INFO  com.google.bitcoin.core.Peer - [88.192.246.174]:8333 - Socket is disconnected
+1360879 [New I/O worker #5] INFO  com.google.bitcoin.core.Peer - [109.235.49.27]:8333 - Socket is disconnected
+3976 [WalletAppKit STARTING] INFO  c.g.bitcoin.core.AbstractBlockChain - chain head is at height 279024:
+v2 block: 
+   previous block: 00000000000000015691d330e6a19199dfd5e72dba1961a9e53563b695337e75
+   merkle root: c8f91c4af60a23c50fd4efa70a0b60fd1968e860127911ccf3c1a67a5a7cd5b4
+   time: [1389055557] Tue Jan 07 00:45:57 UTC 2014
+   difficulty target (nBits): 419628831
+   nonce: 1074680677
+
+4516 [PeerGroup STARTING] INFO  com.google.bitcoin.core.PeerGroup - Peer discovery took 439msec
+4547 [PeerGroup STARTING] INFO  com.google.bitcoin.core.Peer - [2001:4801:7819:74:b745:b9d5:ff10:aaec]:8333 - No route to host
+4548 [New I/O worker #2] INFO  com.google.bitcoin.core.PeerGroup - [2001:4801:7819:74:b745:b9d5:ff10:aaec]:8333: Peer died
+4549 [PeerGroup STARTING] INFO  com.google.bitcoin.core.Peer - [2a01:4f8:101:4141:0:0:0:2]:8333 - No route to host
+4549 [New I/O worker #3] INFO  com.google.bitcoin.core.PeerGroup - [2a01:4f8:101:4141:0:0:0:2]:8333: Peer died
+4549 [New I/O worker #2] INFO  com.google.bitcoin.core.Peer - [2001:41d0:8:8f6b:0:0:0:1]:8333 - No route to host
+4549 [PeerGroup STARTING] INFO  com.google.bitcoin.core.Peer - [2001:da8:e000:1103:6ca1:2605:7b:58a3]:8333 - No route to host
+4549 [New I/O worker #4] INFO  com.google.bitcoin.core.PeerGroup - [2001:41d0:8:8f6b:0:0:0:1]:8333: Peer died
+4549 [New I/O worker #5] INFO  com.google.bitcoin.core.PeerGroup - [2001:da8:e000:1103:6ca1:2605:7b:58a3]:8333: Peer died
+4630 [New I/O worker #7] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bitcoin.dashjr.org/76.17.211.189:8333 as: /BitCoinJ:0.10.3/
+4654 [New I/O worker #8] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bitcoin.dashjr.org/66.56.41.123:8333 as: /BitCoinJ:0.10.3/
+4736 [New I/O worker #6] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bluematt.me/130.180.122.103:8333 as: /BitCoinJ:0.10.3/
+4809 [New I/O worker #8] INFO  c.g.b.core.TCPNetworkConnection - Connected to 66.56.41.123: version=70001, subVer='/Satoshi:0.8.5/', services=0x1, time=Tue Jan 07 01:17:00 UTC 2014, blocks=279026
+4825 [New I/O worker #7] INFO  c.g.b.core.TCPNetworkConnection - Connected to 76.17.211.189: version=70001, subVer='/Satoshi:0.8.3/', services=0x1, time=Tue Jan 07 01:16:58 UTC 2014, blocks=279026
+4893 [New I/O worker #8] INFO  com.google.bitcoin.core.PeerGroup - [66.56.41.123]:8333: New peer
+4894 [New I/O worker #8] INFO  com.google.bitcoin.core.PeerGroup - Setting download peer: [66.56.41.123]:8333
+4894 [New I/O worker #8] INFO  c.g.bitcoin.core.DownloadListener - Downloading block chain of size 2. 
+4923 [New I/O worker #7] INFO  com.google.bitcoin.core.PeerGroup - [76.17.211.189]:8333: New peer
+4924 [New I/O worker #6] INFO  com.google.bitcoin.core.PeerGroup - [130.180.122.103]:8333: Peer died
+4924 [New I/O worker #6] INFO  com.google.bitcoin.core.Peer - [2001:470:1f04:c04:0:0:0:2]:8333 - No route to host
+4925 [New I/O worker #9] INFO  com.google.bitcoin.core.PeerGroup - [2001:470:1f04:c04:0:0:0:2]:8333: Peer died
+5079 [New I/O worker #10] INFO  c.g.b.core.TCPNetworkConnection - Announcing to seed.bitcoin.sipa.be/108.7.68.190:8333 as: /BitCoinJ:0.10.3/
+5222 [New I/O worker #10] INFO  c.g.b.core.TCPNetworkConnection - Connected to 108.7.68.190: version=70001, subVer='/Satoshi:0.8.6/', services=0x1, time=Tue Jan 07 01:16:56 UTC 2014, blocks=279026
+5312 [New I/O worker #10] INFO  com.google.bitcoin.core.PeerGroup - [108.7.68.190]:8333: New peer
+6068 [New I/O worker #8] INFO  c.g.bitcoin.core.DownloadListener - Chain download 50% done with 1 blocks to go, block date Jan 7, 2014 12:55:19 AM
+6257 [New I/O worker #8] INFO  c.g.bitcoin.core.DownloadListener - Chain download 100% done with 0 blocks to go, block date Jan 7, 2014 12:58:43 AM
+6548 [New I/O worker #1] INFO  com.google.bitcoin.core.PeerGroup - [101.28.51.40]:8333: Peer died
+6548 [New I/O boss #17] INFO  com.google.bitcoin.core.Peer - [101.28.51.40]:8333 - connection timed out
+6549 [New I/O worker #1] INFO  com.google.bitcoin.core.Peer - [2001:470:7230:ffae:8c40:e0a7:d8f7:30c1]:8333 - No route to host
+6549 [New I/O worker #11] INFO  com.google.bitcoin.core.PeerGroup - [2001:470:7230:ffae:8c40:e0a7:d8f7:30c1]:8333: Peer died
+6763 [New I/O worker #12] INFO  c.g.b.core.TCPNetworkConnection - Announcing to dnsseed.bluematt.me/88.192.246.174:8333 as: /BitCoinJ:0.10.3/
+7068 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Background saving wallet, last seen block is 279026/000000000000000237cd23d88ed708dcfa3146c94ee9d5463bc52807ca8aebc7
+7075 [New I/O worker #12] INFO  c.g.b.core.TCPNetworkConnection - Connected to 88.192.246.174: version=70001, subVer='/Satoshi:0.8.6/', services=0x1, time=Tue Jan 07 01:17:02 UTC 2014, blocks=279026
+7075 [Wallet autosave thread] INFO  c.google.bitcoin.wallet.WalletFiles - Save completed in 7msec
+7283 [New I/O worker #12] INFO  com.google.bitcoin.core.PeerGroup - [88.192.246.174]:8333: New peer
+7284 [New I/O worker #12] INFO  com.google.bitcoin.core.PeerGroup - Unsetting download peer: [66.56.41.123]:8333
+7284 [New I/O worker #12] INFO  com.google.bitcoin.core.PeerGroup - Setting download peer: [108.7.68.190]:8333
diff --git a/server/killbill-bitcoin-testnet.spvchain b/server/killbill-bitcoin-testnet.spvchain
new file mode 100644
index 0000000..3076feb
Binary files /dev/null and b/server/killbill-bitcoin-testnet.spvchain differ
diff --git a/server/killbill-bitcoin-testnet.wallet b/server/killbill-bitcoin-testnet.wallet
new file mode 100644
index 0000000..8c67c72
Binary files /dev/null and b/server/killbill-bitcoin-testnet.wallet differ

server/pom.xml 6(+6 -0)

diff --git a/server/pom.xml b/server/pom.xml
index 9deeea4..935610c 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -209,6 +209,12 @@
         </dependency>
         <dependency>
             <groupId>org.kill-bill.billing</groupId>
+            <artifactId>killbill-catalog</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.kill-bill.billing</groupId>
             <artifactId>killbill-client-java</artifactId>
         </dependency>
         <dependency>
diff --git a/server/src/main/resources/MichielCatalog.xml b/server/src/main/resources/MichielCatalog.xml
new file mode 100644
index 0000000..c96431e
--- /dev/null
+++ b/server/src/main/resources/MichielCatalog.xml
@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="CatalogSchema.xsd">
+
+    <effectiveDate>2013-02-08T00:00:00+00:00</effectiveDate>
+    <catalogName>basic catalog</catalogName>
+
+    <currencies>
+        <currency>EUR</currency>
+    </currencies>
+
+    <products>
+    
+        <product name="instance-m1.tiny">
+            <category>BASE</category>
+        </product>
+        <product name="instance-m1.small">
+            <category>BASE</category>
+        </product>
+        <product name="instance-m1.medium">
+            <category>BASE</category>
+        </product>
+        <product name="instance-m1.large">
+            <category>BASE</category>
+        </product>
+        <product name="instance-m1.xlarge">
+            <category>BASE</category>
+        </product>
+        <product name="instance-m1.micro">
+            <category>BASE</category>
+        </product>
+        <product name="instance-m1.micro2">
+            <category>BASE</category>
+        </product>
+
+        <product name="objectstore-1GB">
+            <category>BASE</category>
+        </product>
+        <product name="objectstore-5GB">
+            <category>BASE</category>
+        </product>
+        <product name="objectstore-10GB">
+            <category>BASE</category>
+        </product>
+
+        <product name="floatingip">
+            <category>BASE</category>
+        </product>
+        
+        <product name="volume-1GB">
+            <category>BASE</category>
+        </product>
+        <product name="volume-2GB">
+            <category>BASE</category>
+        </product>
+        <product name="volume-3GB">
+            <category>BASE</category>
+        </product>
+        <product name="volume-4GB">
+            <category>BASE</category>
+        </product>
+        <product name="volume-5GB">
+            <category>BASE</category>
+        </product>
+
+    </products>
+
+    <rules>
+        <changePolicy>
+            <changePolicyCase>
+                <policy>IMMEDIATE</policy>
+            </changePolicyCase>
+        </changePolicy>
+        <changeAlignment>
+           <changeAlignmentCase>
+                <alignment>START_OF_BUNDLE</alignment>
+            </changeAlignmentCase>
+        </changeAlignment>
+        <cancelPolicy>
+            <cancelPolicyCase>
+                <policy>IMMEDIATE</policy>
+            </cancelPolicyCase>
+        </cancelPolicy>
+        <createAlignment>
+            <createAlignmentCase>
+                <alignment>START_OF_BUNDLE</alignment>
+            </createAlignmentCase>
+        </createAlignment>
+        <billingAlignment>
+            <billingAlignmentCase>
+                <alignment>ACCOUNT</alignment>
+            </billingAlignmentCase>
+        </billingAlignment>
+        <priceList>
+           <priceListCase>
+                <toPriceList>DEFAULT</toPriceList>
+           </priceListCase>
+        </priceList>
+    </rules>
+
+    <plans>
+        <plan name="instance-m1.tiny-monthly">
+            <product>instance-m1.tiny</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>12.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="instance-m1.small-monthly">
+            <product>instance-m1.small</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>18.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="instance-m1.medium-monthly">
+            <product>instance-m1.medium</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>23.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="instance-m1.large-monthly">
+            <product>instance-m1.large</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>39.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="instance-m1.xlarge-monthly">
+            <product>instance-m1.xlarge</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>79.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="instance-m1.micro-monthly">
+            <product>instance-m1.micro</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>5.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="instance-m1.micro2-monthly">
+            <product>instance-m1.micro2</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>7.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+
+        <plan name="objectstore-1GB-monthly">
+            <product>objectstore-1GB</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>2.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="objectstore-5GB-monthly">
+            <product>objectstore-5GB</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="objectstore-10GB-monthly">
+            <product>objectstore-10GB</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>4.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+
+        <plan name="floatingip-monthly">
+            <product>floatingip</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>4.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        
+        <plan name="volume-1GB-monthly">
+            <product>volume-1GB</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>1.50</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="volume-2GB-monthly">
+            <product>volume-2GB</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>2.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="volume-3GB-monthly">
+            <product>volume-3GB</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>2.50</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="volume-4GB-monthly">
+            <product>volume-4GB</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3.00</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+        <plan name="volume-5GB-monthly">
+            <product>volume-5GB</product>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <billingPeriod>MONTHLY</billingPeriod>
+                <recurringPrice>
+                    <price>
+                        <currency>EUR</currency>
+                        <value>3.50</value>
+                    </price>
+                </recurringPrice>
+            </finalPhase>
+        </plan>
+
+    </plans>
+    <priceLists>
+        <defaultPriceList name="DEFAULT">
+            <plans>
+                <plan>instance-m1.tiny-monthly</plan>
+                <plan>instance-m1.small-monthly</plan>
+                <plan>instance-m1.medium-monthly</plan>
+                <plan>instance-m1.large-monthly</plan>
+                <plan>instance-m1.xlarge-monthly</plan>
+                <plan>instance-m1.micro-monthly</plan>
+                <plan>instance-m1.micro2-monthly</plan>
+                <plan>objectstore-1GB-monthly</plan>
+                <plan>objectstore-5GB-monthly</plan>
+                <plan>objectstore-10GB-monthly</plan>
+                <plan>floatingip-monthly</plan>
+                <plan>volume-1GB-monthly</plan>
+                <plan>volume-2GB-monthly</plan>
+                <plan>volume-3GB-monthly</plan>
+                <plan>volume-4GB-monthly</plan>
+                <plan>volume-5GB-monthly</plan>
+            </plans>
+        </defaultPriceList>
+    </priceLists>
+</catalog>
\ No newline at end of file
diff --git a/server/src/main/resources/NitinCatalog.xml b/server/src/main/resources/NitinCatalog.xml
new file mode 100644
index 0000000..1b86525
--- /dev/null
+++ b/server/src/main/resources/NitinCatalog.xml
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
+
+	<effectiveDate>2013-10-01T00:00:00+00:00</effectiveDate>
+	<catalogName>aclcatalog</catalogName>
+
+	<currencies>
+		<currency>USD</currency>
+		<currency>INR</currency>
+		<currency>GBP</currency>
+	</currencies>
+
+   <units>
+       <unit name="shells"/>
+   </units>
+
+	<products>
+		<product name="frenzo-usage">
+			<category>BASE</category>
+           <included>
+           <addonProduct>gift</addonProduct>
+           </included>
+            <available>
+               <addonProduct>extra-gift</addonProduct>
+       </available>
+		</product>
+		<product name="frenzo-mini">
+			<category>BASE</category>
+               <limits>
+                   <limit>
+                       <unit>shells</unit>
+                       <max>5</max>
+                   </limit>
+               </limits>
+		</product>
+		<product name="gift">
+			<category>ADD_ON</category>
+		</product>
+       <product name="extra-gift">
+           <category>ADD_ON</category>
+       </product>
+	</products>
+	 
+	<rules>
+		<changePolicy>
+			<changePolicyCase> 
+				<fromBillingPeriod>MONTHLY</fromBillingPeriod>
+				<toProduct>frenzo-mini</toProduct>
+				<toBillingPeriod>MONTHLY</toBillingPeriod>
+				<policy>END_OF_TERM</policy>
+			</changePolicyCase>
+			<changePolicyCase> 
+				<phaseType>EVERGREEN</phaseType>
+				<policy>IMMEDIATE</policy>
+			</changePolicyCase>	
+		</changePolicy>
+       <changeAlignment>
+           <changeAlignmentCase>
+               <alignment>START_OF_SUBSCRIPTION</alignment>
+           </changeAlignmentCase>
+       </changeAlignment>
+       <createAlignment>
+           <createAlignmentCase>
+               <product>gift</product>
+               <alignment>START_OF_SUBSCRIPTION</alignment>
+           </createAlignmentCase>
+           <createAlignmentCase>
+               <alignment>START_OF_SUBSCRIPTION</alignment>
+           </createAlignmentCase>
+       </createAlignment>
+       <billingAlignment>
+           <billingAlignmentCase>
+               <alignment>ACCOUNT</alignment>
+           </billingAlignmentCase>
+       </billingAlignment>
+       <priceList>
+          <priceListCase>
+               <toPriceList>DEFAULT</toPriceList>
+          </priceListCase>
+       </priceList>
+	</rules> 
+
+	<plans>
+		<plan name="frenzo-usage-monthly">
+			<product>frenzo-usage</product>
+			<!--<initialPhases>
+				<phase type="TRIAL">
+					<duration>
+						<unit>DAYS</unit>
+						<number>1</number>
+					</duration>
+					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
+					<fixedPrice> 
+					</fixedPrice>
+				</phase>
+			</initialPhases>-->
+			<finalPhase type="EVERGREEN">
+				<duration>
+					<unit>UNLIMITED</unit>
+				</duration>
+				<billingPeriod>MONTHLY</billingPeriod>
+				<recurringPrice>
+					<price><currency>GBP</currency><value>29.95</value></price>
+					<price><currency>INR</currency><value>5</value></price> 
+					<price><currency>USD</currency><value>29.95</value></price>								
+				</recurringPrice>
+              <!-- <limits>
+                   <limit>
+                       <unit>targets</unit>
+                       <min>3</min>
+                   </limit>
+                   <limit>
+                       <unit>misfires</unit>
+                       <max>20</max>
+                   </limit>
+               </limits>-->
+			</finalPhase>
+		</plan>
+		<plan name="frenzo-mini-monthly">
+			<product>frenzo-mini</product>
+			<!--<initialPhases>
+				<phase type="TRIAL">
+					<duration>
+						<unit>DAYS</unit>
+						<number>30</number>
+					</duration>
+					<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
+					<fixedPrice></fixedPrice>
+				   
+				</phase>
+			</initialPhases>-->
+			<finalPhase type="EVERGREEN">
+				<duration>
+					<unit>UNLIMITED</unit>
+					<number>-1</number>
+				</duration>
+				<billingPeriod>MONTHLY</billingPeriod>
+				<recurringPrice>
+					<price><currency>USD</currency><value>249.95</value></price>								
+					<price><currency>INR</currency><value>1</value></price>
+					<price><currency>GBP</currency><value>169.95</value></price>
+				</recurringPrice>
+			</finalPhase>
+		</plan>
+       <plan name="gift-monthly">
+       <product>gift</product>
+           <finalPhase type="EVERGREEN">
+               <duration>
+                   <unit>UNLIMITED</unit>
+               </duration>
+               <billingPeriod>MONTHLY</billingPeriod>
+               <recurringPrice>
+                   <price><currency>USD</currency><value>1999.95</value></price>                               
+                   <price><currency>INR</currency><value>2</value></price>
+                   <price><currency>GBP</currency><value>1999.95</value></price>
+               </recurringPrice>
+           </finalPhase>
+       </plan>
+       <plan name="extra-gift-monthly">
+       <product>extra-gift</product>
+           <finalPhase type="EVERGREEN">
+               <duration>
+                   <unit>UNLIMITED</unit>
+               </duration>
+               <billingPeriod>MONTHLY</billingPeriod>
+               <recurringPrice>
+                   <price><currency>USD</currency><value>1999.95</value></price>                               
+                   <price><currency>INR</currency><value>5</value></price>
+                   <price><currency>GBP</currency><value>1999.95</value></price>
+               </recurringPrice>
+           </finalPhase>
+       </plan>
+	</plans>
+	<priceLists>
+		<defaultPriceList name="DEFAULT">
+				<plans>	
+					<plan>frenzo-usage-monthly</plan>
+					<plan>frenzo-mini-monthly</plan>
+			</plans>
+		</defaultPriceList>
+	</priceLists>
+</catalog>
+
diff --git a/server/src/main/resources/SpyCarAdvanced.xml b/server/src/main/resources/SpyCarAdvanced.xml
index e11a107..99eecee 100644
--- a/server/src/main/resources/SpyCarAdvanced.xml
+++ b/server/src/main/resources/SpyCarAdvanced.xml
@@ -21,6 +21,8 @@
     <effectiveDate>2013-02-08T00:00:00+00:00</effectiveDate>
     <catalogName>SpyCarAdvanced</catalogName>
 
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
+
     <currencies>
         <currency>USD</currency>
         <currency>GBP</currency>
@@ -153,38 +155,41 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>ANNUAL</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>750.00</value>
-                    </price>
-                    <price>
-                        <currency>EUR</currency>
-                        <value>850.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>1000.00</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>100.00</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>1.0</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>ANNUAL</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>750.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>850.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1000.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>100.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>1.0</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="standard-monthly">
@@ -195,38 +200,41 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>75.00</value>
-                    </price>
-                    <price>
-                        <currency>EUR</currency>
-                        <value>85.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>100.00</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>10.00</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>0.1</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>75.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>85.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>100.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>10.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>0.1</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="sports-monthly">
@@ -237,38 +245,41 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>375.00</value>
-                    </price>
-                    <price>
-                        <currency>EUR</currency>
-                        <value>425.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>500.00</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>50.00</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>0.5</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>375.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>425.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>500.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>50.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>0.5</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="super-monthly">
@@ -279,38 +290,41 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>750.00</value>
-                    </price>
-                    <price>
-                        <currency>EUR</currency>
-                        <value>850.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>1000.00</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>100.00</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>1.0</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>750.00</value>
+                        </price>
+                        <price>
+                            <currency>EUR</currency>
+                            <value>850.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1000.00</value>
+                        </price>
+                        <price>
+                            <currency>JPY</currency>
+                            <value>100.00</value>
+                        </price>
+                        <price>
+                            <currency>BTC</currency>
+                            <value>1.0</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="discount-standard-monthly">
@@ -321,67 +335,72 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
                 <phase type="DISCOUNT">
                     <duration>
                         <unit>MONTHS</unit>
                         <number>3</number>
                     </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>50.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>60.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>66.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>6.60</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.06</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
                     <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
                         <price>
                             <currency>GBP</currency>
-                            <value>50.00</value>
+                            <value>75.00</value>
                         </price>
                         <price>
                             <currency>EUR</currency>
-                            <value>60.00</value>
+                            <value>85.00</value>
                         </price>
                         <price>
                             <currency>USD</currency>
-                            <value>66.00</value>
+                            <value>100.00</value>
                         </price>
                         <price>
                             <currency>JPY</currency>
-                            <value>6.60</value>
+                            <value>10.00</value>
                         </price>
                         <price>
                             <currency>BTC</currency>
-                            <value>0.06</value>
+                            <value>0.1</value>
                         </price>
                     </recurringPrice>
-                </phase>
-            </initialPhases>
-            <finalPhase type="EVERGREEN">
-                <duration>
-                    <unit>UNLIMITED</unit>
-                </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>75.00</value>
-                    </price>
-                    <price>
-                        <currency>EUR</currency>
-                        <value>85.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>100.00</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>10.00</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>0.1</value>
-                    </price>
-                </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="discount-sports-monthly">
@@ -392,67 +411,72 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
                 <phase type="DISCOUNT">
                     <duration>
                         <unit>MONTHS</unit>
                         <number>3</number>
                     </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>250.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>300.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>333.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>33.30</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.3</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
                     <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
                         <price>
                             <currency>GBP</currency>
-                            <value>250.00</value>
+                            <value>375.00</value>
                         </price>
                         <price>
                             <currency>EUR</currency>
-                            <value>300.00</value>
+                            <value>425.00</value>
                         </price>
                         <price>
                             <currency>USD</currency>
-                            <value>333.00</value>
+                            <value>500.00</value>
                         </price>
                         <price>
                             <currency>JPY</currency>
-                            <value>33.30</value>
+                            <value>50.00</value>
                         </price>
                         <price>
                             <currency>BTC</currency>
-                            <value>0.3</value>
+                            <value>0.5</value>
                         </price>
                     </recurringPrice>
-                </phase>
-            </initialPhases>
-            <finalPhase type="EVERGREEN">
-                <duration>
-                    <unit>UNLIMITED</unit>
-                </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>375.00</value>
-                    </price>
-                    <price>
-                        <currency>EUR</currency>
-                        <value>425.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>500.00</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>50.00</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>0.5</value>
-                    </price>
-                </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="discount-super-monthly">
@@ -463,67 +487,72 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
                 <phase type="DISCOUNT">
                     <duration>
                         <unit>MONTHS</unit>
                         <number>3</number>
                     </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>500.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>600.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>666.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>66.60</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.6</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
                     <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
                         <price>
                             <currency>GBP</currency>
-                            <value>500.00</value>
+                            <value>750.00</value>
                         </price>
                         <price>
                             <currency>EUR</currency>
-                            <value>600.00</value>
+                            <value>850.00</value>
                         </price>
                         <price>
                             <currency>USD</currency>
-                            <value>666.00</value>
+                            <value>1000.00</value>
                         </price>
                         <price>
                             <currency>JPY</currency>
-                            <value>66.60</value>
+                            <value>100.00</value>
                         </price>
                         <price>
                             <currency>BTC</currency>
-                            <value>0.6</value>
+                            <value>1.0</value>
                         </price>
                     </recurringPrice>
-                </phase>
-            </initialPhases>
-            <finalPhase type="EVERGREEN">
-                <duration>
-                    <unit>UNLIMITED</unit>
-                </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>750.00</value>
-                    </price>
-                    <price>
-                        <currency>EUR</currency>
-                        <value>850.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>1000.00</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>100.00</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>1.0</value>
-                    </price>
-                </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="oilslick-monthly">
@@ -534,54 +563,58 @@
                         <unit>MONTHS</unit>
                         <number>1</number>
                     </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>2.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>3.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>4.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>0.40</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.01</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
                     <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
                         <price>
                             <currency>GBP</currency>
-                            <value>2.00</value>
-                        </price>
-                        <price>
-                            <currency>EUR</currency>
-                            <value>3.00</value>
+                            <value>5.95</value>
                         </price>
                         <price>
                             <currency>USD</currency>
-                            <value>4.00</value>
+                            <value>7.95</value>
                         </price>
                         <price>
                             <currency>JPY</currency>
-                            <value>0.40</value>
+                            <value>0.80</value>
                         </price>
                         <price>
                             <currency>BTC</currency>
                             <value>0.01</value>
                         </price>
                     </recurringPrice>
-                </phase>
-            </initialPhases>
-            <finalPhase type="EVERGREEN">
-                <duration>
-                    <unit>UNLIMITED</unit>
-                </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>5.95</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>7.95</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>0.80</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>0.01</value>
-                    </price>
-                </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="remotecontrol-monthly">
@@ -592,58 +625,62 @@
                         <unit>MONTHS</unit>
                         <number>1</number>
                     </duration>
+                    <recurring>
+                        <billingPeriod>MONTHLY</billingPeriod>
+                        <recurringPrice>
+                            <price>
+                                <currency>GBP</currency>
+                                <value>5.00</value>
+                            </price>
+                            <price>
+                                <currency>EUR</currency>
+                                <value>7.00</value>
+                            </price>
+                            <price>
+                                <currency>USD</currency>
+                                <value>8.00</value>
+                            </price>
+                            <price>
+                                <currency>JPY</currency>
+                                <value>0.80</value>
+                            </price>
+                            <price>
+                                <currency>BTC</currency>
+                                <value>0.01</value>
+                            </price>
+                        </recurringPrice>
+                    </recurring>
+                </phase>
+            </initialPhases>
+            <finalPhase type="EVERGREEN">
+                <duration>
+                    <unit>UNLIMITED</unit>
+                </duration>
+                <recurring>
                     <billingPeriod>MONTHLY</billingPeriod>
                     <recurringPrice>
                         <price>
                             <currency>GBP</currency>
-                            <value>5.00</value>
+                            <value>15.95</value>
                         </price>
                         <price>
                             <currency>EUR</currency>
-                            <value>7.00</value>
+                            <value>16.95</value>
                         </price>
                         <price>
                             <currency>USD</currency>
-                            <value>8.00</value>
+                            <value>17.95</value>
                         </price>
                         <price>
                             <currency>JPY</currency>
-                            <value>0.80</value>
+                            <value>1.79</value>
                         </price>
                         <price>
                             <currency>BTC</currency>
                             <value>0.01</value>
                         </price>
                     </recurringPrice>
-                </phase>
-            </initialPhases>
-            <finalPhase type="EVERGREEN">
-                <duration>
-                    <unit>UNLIMITED</unit>
-                </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>15.95</value>
-                    </price>
-                    <price>
-                        <currency>EUR</currency>
-                        <value>16.95</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>17.95</value>
-                    </price>
-                    <price>
-                        <currency>JPY</currency>
-                        <value>1.79</value>
-                    </price>
-                    <price>
-                        <currency>BTC</currency>
-                        <value>0.01</value>
-                    </price>
-                </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
     </plans>
diff --git a/server/src/main/resources/SpyCarBasic.xml b/server/src/main/resources/SpyCarBasic.xml
index 7db7465..e69cfed 100644
--- a/server/src/main/resources/SpyCarBasic.xml
+++ b/server/src/main/resources/SpyCarBasic.xml
@@ -16,11 +16,13 @@
   -->
 
 <catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
+         xsi:noNamespaceSchemaLocation="CatalogSchema.xsd ">
 
     <effectiveDate>2013-02-08T00:00:00+00:00</effectiveDate>
     <catalogName>SpyCarBasic</catalogName>
 
+    <recurringBillingMode>IN_ADVANCE</recurringBillingMode>
+
     <currencies>
         <currency>USD</currency>
         <currency>GBP</currency>
@@ -45,7 +47,7 @@
             </changePolicyCase>
         </changePolicy>
         <changeAlignment>
-           <changeAlignmentCase>
+            <changeAlignmentCase>
                 <alignment>START_OF_BUNDLE</alignment>
             </changeAlignmentCase>
         </changeAlignment>
@@ -65,9 +67,9 @@
             </billingAlignmentCase>
         </billingAlignment>
         <priceList>
-           <priceListCase>
+            <priceListCase>
                 <toPriceList>DEFAULT</toPriceList>
-           </priceListCase>
+            </priceListCase>
         </priceList>
     </rules>
 
@@ -80,26 +82,30 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>75.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>100.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>75.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>100.00</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="sports-monthly">
@@ -110,26 +116,29 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>375.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>500.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>375.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>500.00</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
         <plan name="super-monthly">
@@ -140,26 +149,30 @@
                         <unit>DAYS</unit>
                         <number>30</number>
                     </duration>
-                    <billingPeriod>NO_BILLING_PERIOD</billingPeriod>
-                    <fixedPrice> <!-- empty price implies $0 -->
-                    </fixedPrice>
+                    <fixed>
+                        <fixedPrice> <!-- empty price implies $0 -->
+                        </fixedPrice>
+
+                    </fixed>
                 </phase>
             </initialPhases>
             <finalPhase type="EVERGREEN">
                 <duration>
                     <unit>UNLIMITED</unit>
                 </duration>
-                <billingPeriod>MONTHLY</billingPeriod>
-                <recurringPrice>
-                    <price>
-                        <currency>GBP</currency>
-                        <value>750.00</value>
-                    </price>
-                    <price>
-                        <currency>USD</currency>
-                        <value>1000.00</value>
-                    </price>
-                </recurringPrice>
+                <recurring>
+                    <billingPeriod>MONTHLY</billingPeriod>
+                    <recurringPrice>
+                        <price>
+                            <currency>GBP</currency>
+                            <value>750.00</value>
+                        </price>
+                        <price>
+                            <currency>USD</currency>
+                            <value>1000.00</value>
+                        </price>
+                    </recurringPrice>
+                </recurring>
             </finalPhase>
         </plan>
     </plans>
diff --git a/server/src/test/resources/killbill.properties b/server/src/test/resources/killbill.properties
index 0c1abba..1b1e335 100644
--- a/server/src/test/resources/killbill.properties
+++ b/server/src/test/resources/killbill.properties
@@ -14,7 +14,7 @@
 # under the License.
 #
 
-org.killbill.catalog.uri=catalog-weapons.xml
+org.killbill.catalog.uri=catalogTest.xml
 org.killbill.overdue.uri=overdue.xml
 
 org.killbill.payment.retry.days=8,8,8
diff --git a/subscription/src/main/java/org/killbill/billing/subscription/alignment/PlanAligner.java b/subscription/src/main/java/org/killbill/billing/subscription/alignment/PlanAligner.java
index c219b7c..27bc7e6 100644
--- a/subscription/src/main/java/org/killbill/billing/subscription/alignment/PlanAligner.java
+++ b/subscription/src/main/java/org/killbill/billing/subscription/alignment/PlanAligner.java
@@ -195,7 +195,7 @@ public class PlanAligner extends BaseAligner {
 
         final PlanSpecifier planSpecifier = new PlanSpecifier(plan.getProduct().getName(),
                                                               plan.getProduct().getCategory(),
-                                                              plan.getBillingPeriod(),
+                                                              plan.getRecurringBillingPeriod(),
                                                               priceList);
 
         final DateTime planStartDate;
@@ -246,13 +246,13 @@ public class PlanAligner extends BaseAligner {
         final ProductCategory currentCategory = currentPlan.getProduct().getCategory();
         final PlanPhaseSpecifier fromPlanPhaseSpecifier = new PlanPhaseSpecifier(currentPlan.getProduct().getName(),
                                                                                  currentCategory,
-                                                                                 currentPlan.getBillingPeriod(),
+                                                                                 currentPlan.getRecurringBillingPeriod(),
                                                                                  currentPriceList,
                                                                                  currentPhase.getPhaseType());
 
         final PlanSpecifier toPlanSpecifier = new PlanSpecifier(nextPlan.getProduct().getName(),
                                                                 nextPlan.getProduct().getCategory(),
-                                                                nextPlan.getBillingPeriod(),
+                                                                nextPlan.getRecurringBillingPeriod(),
                                                                 priceList);
 
         final DateTime planStartDate;
diff --git a/subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java b/subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java
index 9435853..d82a0e1 100644
--- a/subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java
+++ b/subscription/src/main/java/org/killbill/billing/subscription/api/svcs/DefaultSubscriptionInternalApi.java
@@ -374,7 +374,7 @@ public class DefaultSubscriptionInternalApi extends SubscriptionApiBase implemen
             final EntitlementAOStatusDryRun status = new DefaultSubscriptionStatusDryRun(cur.getId(),
                                                                                          cur.getCurrentPlan().getProduct().getName(),
                                                                                          cur.getCurrentPhase().getPhaseType(),
-                                                                                         cur.getCurrentPlan().getBillingPeriod(),
+                                                                                         cur.getCurrentPlan().getRecurringBillingPeriod(),
                                                                                          cur.getCurrentPriceList().getName(), reason);
             result.add(status);
         }
diff --git a/subscription/src/main/java/org/killbill/billing/subscription/api/timeline/DefaultSubscriptionBaseTimeline.java b/subscription/src/main/java/org/killbill/billing/subscription/api/timeline/DefaultSubscriptionBaseTimeline.java
index 81447ed..af2acc8 100644
--- a/subscription/src/main/java/org/killbill/billing/subscription/api/timeline/DefaultSubscriptionBaseTimeline.java
+++ b/subscription/src/main/java/org/killbill/billing/subscription/api/timeline/DefaultSubscriptionBaseTimeline.java
@@ -23,6 +23,8 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.UUID;
 
+import javax.annotation.Nullable;
+
 import org.joda.time.DateTime;
 
 import org.killbill.billing.catalog.api.BillingPeriod;
@@ -30,6 +32,7 @@ import org.killbill.billing.catalog.api.Catalog;
 import org.killbill.billing.catalog.api.CatalogApiException;
 import org.killbill.billing.catalog.api.PhaseType;
 import org.killbill.billing.catalog.api.Plan;
+import org.killbill.billing.catalog.api.PlanPhase;
 import org.killbill.billing.catalog.api.PlanPhaseSpecifier;
 import org.killbill.billing.catalog.api.ProductCategory;
 import org.killbill.billing.subscription.api.SubscriptionBaseTransitionType;
@@ -78,6 +81,14 @@ public class DefaultSubscriptionBaseTimeline implements SubscriptionBaseTimeline
         this.activeVersion = input.getActiveVersion();
     }
 
+    private BillingPeriod getBillingPeriod(final Catalog catalog, @Nullable final String phaseName, final DateTime effectiveDate, DateTime startDate) throws CatalogApiException {
+        if (phaseName == null) {
+            return BillingPeriod.NO_BILLING_PERIOD;
+        }
+        final PlanPhase phase = catalog.findPhase(phaseName, effectiveDate, startDate);
+        return phase.getRecurring() != null ? phase.getRecurring().getBillingPeriod() : BillingPeriod.NO_BILLING_PERIOD;
+    }
+
     private List<ExistingEvent> toExistingEvents(final Catalog catalog, final long activeVersion, final ProductCategory category, final List<SubscriptionBaseEvent> events)
             throws CatalogApiException {
 
@@ -115,7 +126,7 @@ public class DefaultSubscriptionBaseTimeline implements SubscriptionBaseTimeline
                     planPhaseName = phaseEV.getPhase();
                     phaseType = catalog.findPhase(phaseEV.getPhase(), cur.getEffectiveDate(), startDate).getPhaseType();
                     productName = prevProductName;
-                    billingPeriod = catalog.findPhase(phaseEV.getPhase(), cur.getEffectiveDate(), startDate).getBillingPeriod();
+                    billingPeriod = getBillingPeriod(catalog, phaseEV.getPhase(), cur.getEffectiveDate(), startDate);
                     priceListName = prevPriceListName;
                     break;
 
@@ -126,7 +137,7 @@ public class DefaultSubscriptionBaseTimeline implements SubscriptionBaseTimeline
                     final Plan plan = (userEV.getEventPlan() != null) ? catalog.findPlan(userEV.getEventPlan(), cur.getRequestedDate(), startDate) : null;
                     phaseType = (userEV.getEventPlanPhase() != null) ? catalog.findPhase(userEV.getEventPlanPhase(), cur.getEffectiveDate(), startDate).getPhaseType() : prevPhaseType;
                     productName = (plan != null) ? plan.getProduct().getName() : prevProductName;
-                    billingPeriod = (userEV.getEventPlanPhase() != null) ? catalog.findPhase(userEV.getEventPlanPhase(), cur.getEffectiveDate(), startDate).getBillingPeriod() : prevBillingPeriod;
+                    billingPeriod = (userEV.getEventPlanPhase() != null) ? getBillingPeriod(catalog, userEV.getEventPlanPhase(), cur.getEffectiveDate(), startDate) : prevBillingPeriod;
                     priceListName = (userEV.getPriceList() != null) ? userEV.getPriceList() : prevPriceListName;
                     break;
             }
diff --git a/subscription/src/main/java/org/killbill/billing/subscription/api/user/DefaultSubscriptionBase.java b/subscription/src/main/java/org/killbill/billing/subscription/api/user/DefaultSubscriptionBase.java
index 285899c..3814305 100644
--- a/subscription/src/main/java/org/killbill/billing/subscription/api/user/DefaultSubscriptionBase.java
+++ b/subscription/src/main/java/org/killbill/billing/subscription/api/user/DefaultSubscriptionBase.java
@@ -314,9 +314,9 @@ public class DefaultSubscriptionBase extends EntityBase implements SubscriptionB
     public BillingPeriod getLastActiveBillingPeriod() {
         if (getState() == EntitlementState.CANCELLED) {
             final SubscriptionBaseTransition data = getPreviousTransition();
-            return data.getPreviousPlan().getBillingPeriod();
+            return data.getPreviousPlan().getRecurringBillingPeriod();
         } else {
-            return getCurrentPlan().getBillingPeriod();
+            return getCurrentPlan().getRecurringBillingPeriod();
         }
     }
 
diff --git a/subscription/src/main/java/org/killbill/billing/subscription/api/user/DefaultSubscriptionBaseApiService.java b/subscription/src/main/java/org/killbill/billing/subscription/api/user/DefaultSubscriptionBaseApiService.java
index ba1ea44..32199b0 100644
--- a/subscription/src/main/java/org/killbill/billing/subscription/api/user/DefaultSubscriptionBaseApiService.java
+++ b/subscription/src/main/java/org/killbill/billing/subscription/api/user/DefaultSubscriptionBaseApiService.java
@@ -179,7 +179,7 @@ public class DefaultSubscriptionBaseApiService implements SubscriptionBaseApiSer
         final Plan currentPlan = subscription.getCurrentPlan();
         final PlanPhaseSpecifier planPhase = new PlanPhaseSpecifier(currentPlan.getProduct().getName(),
                                                                     currentPlan.getProduct().getCategory(),
-                                                                    subscription.getCurrentPlan().getBillingPeriod(),
+                                                                    subscription.getCurrentPlan().getRecurringBillingPeriod(),
                                                                     subscription.getCurrentPriceList().getName(),
                                                                     subscription.getCurrentPhase().getPhaseType());
 
@@ -331,7 +331,7 @@ public class DefaultSubscriptionBaseApiService implements SubscriptionBaseApiSer
             final PriceList currentPriceList = subscription.getCurrentPriceList();
             final PlanPhaseSpecifier fromPlanPhase = new PlanPhaseSpecifier(currentPlan.getProduct().getName(),
                                                                             currentPlan.getProduct().getCategory(),
-                                                                            currentPlan.getBillingPeriod(),
+                                                                            currentPlan.getRecurringBillingPeriod(),
                                                                             currentPriceList.getName(),
                                                                             subscription.getCurrentPhase().getPhaseType());
             final PlanSpecifier toPlanPhase = new PlanSpecifier(productName,
@@ -391,7 +391,7 @@ public class DefaultSubscriptionBaseApiService implements SubscriptionBaseApiSer
         }
 
         final boolean isChangeImmediate = subscription.getCurrentPlan().getProduct().getName().equals(newProductName) &&
-                                          subscription.getCurrentPlan().getBillingPeriod() == newBillingPeriod;
+                                          subscription.getCurrentPlan().getRecurringBillingPeriod() == newBillingPeriod;
         return effectiveDate;
     }
 
diff --git a/subscription/src/test/java/org/killbill/billing/subscription/alignment/TestPlanAligner.java b/subscription/src/test/java/org/killbill/billing/subscription/alignment/TestPlanAligner.java
index 927afd9..0056f86 100644
--- a/subscription/src/test/java/org/killbill/billing/subscription/alignment/TestPlanAligner.java
+++ b/subscription/src/test/java/org/killbill/billing/subscription/alignment/TestPlanAligner.java
@@ -54,13 +54,14 @@ public class TestPlanAligner extends SubscriptionTestSuiteNoDB {
 
     private final DefaultClock clock = new DefaultClock();
 
-    private DefaultCatalogService catalogService;
     private PlanAligner planAligner;
 
     @Override
     @BeforeClass(groups = "fast")
     public void beforeClass() throws Exception {
         super.beforeClass();
+
+        /*
         final VersionedCatalogLoader versionedCatalogLoader = new VersionedCatalogLoader(clock);
         final CatalogConfig config = new ConfigurationObjectFactory(new ConfigSource() {
             final Map<String, String> properties = ImmutableMap.<String, String>of("org.killbill.catalog.uri", "file:src/test/resources/testInput.xml");
@@ -72,9 +73,9 @@ public class TestPlanAligner extends SubscriptionTestSuiteNoDB {
         }).build(CatalogConfig.class);
 
         catalogService = new DefaultCatalogService(config, versionedCatalogLoader);
+        */
         planAligner = new PlanAligner(catalogService);
 
-        catalogService.loadCatalog();
     }
 
     @Test(groups = "fast")
diff --git a/subscription/src/test/java/org/killbill/billing/subscription/api/timeline/TestRepairBP.java b/subscription/src/test/java/org/killbill/billing/subscription/api/timeline/TestRepairBP.java
index 6473cd9..a7c6624 100644
--- a/subscription/src/test/java/org/killbill/billing/subscription/api/timeline/TestRepairBP.java
+++ b/subscription/src/test/java/org/killbill/billing/subscription/api/timeline/TestRepairBP.java
@@ -170,7 +170,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), baseProduct);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         final PlanPhase currentPhase = dryRunBaseSubscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -255,7 +255,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), newBaseProduct);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         final PlanPhase currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -341,7 +341,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), baseProduct);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         PlanPhase currentPhase = dryRunBaseSubscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -381,7 +381,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), newBaseProduct);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         currentPhase = realRunBaseSubscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -425,7 +425,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), newBaseProduct);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         final PlanPhase currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -512,7 +512,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), baseProduct);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         PlanPhase currentPhase = dryRunBaseSubscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -550,7 +550,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), newBaseProduct);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         currentPhase = realRunBaseSubscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -588,7 +588,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), "Shotgun");
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         final DateTime repairTime = clock.getUTCNow().minusDays(1);
         final BundleBaseTimeline bundleRepair = repairApi.getBundleTimeline(bundle.getId(), callContext);
@@ -620,7 +620,7 @@ public class TestRepairBP extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), "Assault-Rifle");
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         final PlanPhase currentPhase = baseSubscription.getCurrentPhase();
         assertNotNull(currentPhase);
diff --git a/subscription/src/test/java/org/killbill/billing/subscription/api/timeline/TestRepairWithAO.java b/subscription/src/test/java/org/killbill/billing/subscription/api/timeline/TestRepairWithAO.java
index 19346a2..f5d10a9 100644
--- a/subscription/src/test/java/org/killbill/billing/subscription/api/timeline/TestRepairWithAO.java
+++ b/subscription/src/test/java/org/killbill/billing/subscription/api/timeline/TestRepairWithAO.java
@@ -704,7 +704,7 @@ public class TestRepairWithAO extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), "Laser-Scope");
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.ADD_ON);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         PlanPhase currentPhase = newAoSubscription.getCurrentPhase();
         assertNotNull(currentPhase);
diff --git a/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiAddOn.java b/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiAddOn.java
index aa8003e..5daba7c 100644
--- a/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiAddOn.java
+++ b/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiAddOn.java
@@ -444,7 +444,7 @@ public class TestUserApiAddOn extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(aoCurrentPlan);
         assertEquals(aoCurrentPlan.getProduct().getName(), aoProduct);
         assertEquals(aoCurrentPlan.getProduct().getCategory(), ProductCategory.ADD_ON);
-        assertEquals(aoCurrentPlan.getBillingPeriod(), aoTerm);
+        assertEquals(aoCurrentPlan.getRecurringBillingPeriod(), aoTerm);
 
         PlanPhase aoCurrentPhase = aoSubscription.getCurrentPhase();
         assertNotNull(aoCurrentPhase);
@@ -477,7 +477,7 @@ public class TestUserApiAddOn extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(aoCurrentPlan);
         assertEquals(aoCurrentPlan.getProduct().getName(), aoProduct);
         assertEquals(aoCurrentPlan.getProduct().getCategory(), ProductCategory.ADD_ON);
-        assertEquals(aoCurrentPlan.getBillingPeriod(), aoTerm);
+        assertEquals(aoCurrentPlan.getRecurringBillingPeriod(), aoTerm);
 
         aoCurrentPhase = aoSubscription.getCurrentPhase();
         assertNotNull(aoCurrentPhase);
diff --git a/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiChangePlan.java b/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiChangePlan.java
index 34c9126..3699306 100644
--- a/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiChangePlan.java
+++ b/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiChangePlan.java
@@ -50,7 +50,7 @@ public class TestUserApiChangePlan extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), expProduct);
         assertEquals(currentPlan.getProduct().getCategory(), expCategory);
-        assertEquals(currentPlan.getBillingPeriod(), expBillingPeriod);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), expBillingPeriod);
 
         final PlanPhase currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -298,7 +298,7 @@ public class TestUserApiChangePlan extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), "Assault-Rifle");
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         final PlanPhase currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -340,7 +340,7 @@ public class TestUserApiChangePlan extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), "Assault-Rifle");
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         PlanPhase currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -356,7 +356,7 @@ public class TestUserApiChangePlan extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), "Pistol");
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -373,7 +373,7 @@ public class TestUserApiChangePlan extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), "Pistol");
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -402,7 +402,7 @@ public class TestUserApiChangePlan extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), "Assault-Rifle");
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.ANNUAL);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
 
         trialPhase = subscription.getCurrentPhase();
         assertEquals(trialPhase.getPhaseType(), PhaseType.TRIAL);
diff --git a/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiCreate.java b/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiCreate.java
index 22eeaba..f479f79 100644
--- a/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiCreate.java
+++ b/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiCreate.java
@@ -144,7 +144,7 @@ public class TestUserApiCreate extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), productName);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         final PlanPhase currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
@@ -178,7 +178,7 @@ public class TestUserApiCreate extends SubscriptionTestSuiteWithEmbeddedDB {
         assertNotNull(currentPlan);
         assertEquals(currentPlan.getProduct().getName(), productName);
         assertEquals(currentPlan.getProduct().getCategory(), ProductCategory.BASE);
-        assertEquals(currentPlan.getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(currentPlan.getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
 
         final PlanPhase currentPhase = subscription.getCurrentPhase();
         assertNotNull(currentPhase);
diff --git a/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiError.java b/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiError.java
index ed778b4..724360c 100644
--- a/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiError.java
+++ b/subscription/src/test/java/org/killbill/billing/subscription/api/user/TestUserApiError.java
@@ -122,13 +122,13 @@ public class TestUserApiError extends SubscriptionTestSuiteNoDB {
             Assert.fail();
         } catch (SubscriptionBaseError error) {
             assertTrue(true);
-            assertEquals(subscriptionInternalApi.getSubscriptionFromId(subscription.getId(), internalCallContext).getCurrentPlan().getBillingPeriod(), BillingPeriod.ANNUAL);
+            assertEquals(subscriptionInternalApi.getSubscriptionFromId(subscription.getId(), internalCallContext).getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.ANNUAL);
         }
 
         // Assume the call takes less than a second
         assertEquals(DefaultClock.truncateMs(subscription.changePlanWithPolicy("Shotgun", BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, BillingActionPolicy.IMMEDIATE, callContext)),
                      DefaultClock.truncateMs(clock.getUTCNow()));
-        assertEquals(subscriptionInternalApi.getSubscriptionFromId(subscription.getId(), internalCallContext).getCurrentPlan().getBillingPeriod(), BillingPeriod.MONTHLY);
+        assertEquals(subscriptionInternalApi.getSubscriptionFromId(subscription.getId(), internalCallContext).getCurrentPlan().getRecurringBillingPeriod(), BillingPeriod.MONTHLY);
     }
 
     @Test(groups = "fast")
diff --git a/subscription/src/test/resources/subscription.properties b/subscription/src/test/resources/subscription.properties
index a407638..46a797b 100644
--- a/subscription/src/test/resources/subscription.properties
+++ b/subscription/src/test/resources/subscription.properties
@@ -1 +1 @@
-org.killbill.catalog.uri=file:src/test/resources/testInput.xml
+org.killbill.catalog.uri=catalogTest.xml
diff --git a/usage/src/main/java/org/killbill/billing/usage/api/user/DefaultUsageUserApi.java b/usage/src/main/java/org/killbill/billing/usage/api/user/DefaultUsageUserApi.java
index 2ae8f34..5b771d9 100644
--- a/usage/src/main/java/org/killbill/billing/usage/api/user/DefaultUsageUserApi.java
+++ b/usage/src/main/java/org/killbill/billing/usage/api/user/DefaultUsageUserApi.java
@@ -17,6 +17,9 @@
 package org.killbill.billing.usage.api.user;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
 import java.util.UUID;
 
 import javax.inject.Inject;
@@ -24,6 +27,7 @@ import javax.inject.Inject;
 import org.joda.time.DateTime;
 
 import org.killbill.billing.ObjectType;
+import org.killbill.billing.callcontext.InternalTenantContext;
 import org.killbill.billing.usage.api.RolledUpUsage;
 import org.killbill.billing.usage.api.UsageUserApi;
 import org.killbill.billing.usage.dao.RolledUpUsageDao;
@@ -53,8 +57,26 @@ public class DefaultUsageUserApi implements UsageUserApi {
     }
 
     @Override
-    public RolledUpUsage getUsageForSubscription(final UUID subscriptionId, final TenantContext context) {
-        final RolledUpUsageModelDao usageForSubscription = rolledUpUsageDao.getUsageForSubscription(subscriptionId, internalCallContextFactory.createInternalTenantContext(context));
+    public RolledUpUsage getUsageForSubscription(final UUID subscriptionId,  final String unitType, final DateTime startTime, final DateTime endTime, final TenantContext context) {
+        final RolledUpUsageModelDao usageForSubscription = rolledUpUsageDao.getUsageForSubscription(subscriptionId, startTime, endTime, unitType, internalCallContextFactory.createInternalTenantContext(context));
         return new DefaultRolledUpUsage(usageForSubscription);
     }
+
+    @Override
+    public List<RolledUpUsage> getAllUsageForSubscription(final UUID subscriptionId, final Set<String> unitTypes, final List<DateTime> transitionTimes, final TenantContext tenantContext) {
+
+        final InternalTenantContext internalCallContext = internalCallContextFactory.createInternalTenantContext(subscriptionId, ObjectType.SUBSCRIPTION, tenantContext);
+        List<RolledUpUsage> result = new ArrayList<RolledUpUsage>();
+        DateTime prevDate = null;
+        for (DateTime curDate : transitionTimes) {
+            if (prevDate != null) {
+                for (String unitType : unitTypes) {
+                    final RolledUpUsageModelDao usageForSubscription = rolledUpUsageDao.getUsageForSubscription(subscriptionId, prevDate, curDate, unitType, internalCallContext);
+                    result.add(new DefaultRolledUpUsage(usageForSubscription));
+                }
+            }
+            prevDate = curDate;
+        }
+        return result;
+    }
 }
diff --git a/usage/src/main/java/org/killbill/billing/usage/dao/DefaultRolledUpUsageDao.java b/usage/src/main/java/org/killbill/billing/usage/dao/DefaultRolledUpUsageDao.java
index 353a799..9c190c8 100644
--- a/usage/src/main/java/org/killbill/billing/usage/dao/DefaultRolledUpUsageDao.java
+++ b/usage/src/main/java/org/killbill/billing/usage/dao/DefaultRolledUpUsageDao.java
@@ -17,11 +17,15 @@
 package org.killbill.billing.usage.dao;
 
 import java.math.BigDecimal;
+import java.util.List;
+import java.util.Set;
 import java.util.UUID;
 
 import javax.inject.Inject;
 
 import org.joda.time.DateTime;
+import org.killbill.billing.usage.api.RolledUpUsage;
+import org.killbill.billing.util.callcontext.TenantContext;
 import org.skife.jdbi.v2.IDBI;
 
 import org.killbill.billing.callcontext.InternalCallContext;
@@ -46,7 +50,8 @@ public class DefaultRolledUpUsageDao implements RolledUpUsageDao {
     }
 
     @Override
-    public RolledUpUsageModelDao getUsageForSubscription(final UUID subscriptionId, final InternalTenantContext context) {
-        return rolledUpUsageSqlDao.getUsageForSubscription(subscriptionId, context);
+    public RolledUpUsageModelDao getUsageForSubscription(UUID subscriptionId, DateTime startTime, DateTime endTime, String unitType, InternalTenantContext context) {
+        final BigDecimal amount = rolledUpUsageSqlDao.getUsageForSubscription(subscriptionId, startTime.toDate(), endTime.toDate(), unitType, context);
+        return new RolledUpUsageModelDao(subscriptionId, unitType, startTime, endTime, amount != null ? amount : BigDecimal.ZERO);
     }
 }
diff --git a/usage/src/main/java/org/killbill/billing/usage/dao/RolledUpUsageDao.java b/usage/src/main/java/org/killbill/billing/usage/dao/RolledUpUsageDao.java
index e0b90a1..225b3c8 100644
--- a/usage/src/main/java/org/killbill/billing/usage/dao/RolledUpUsageDao.java
+++ b/usage/src/main/java/org/killbill/billing/usage/dao/RolledUpUsageDao.java
@@ -17,17 +17,21 @@
 package org.killbill.billing.usage.dao;
 
 import java.math.BigDecimal;
+import java.util.List;
+import java.util.Set;
 import java.util.UUID;
 
 import org.joda.time.DateTime;
 
 import org.killbill.billing.callcontext.InternalCallContext;
 import org.killbill.billing.callcontext.InternalTenantContext;
+import org.killbill.billing.usage.api.RolledUpUsage;
+import org.killbill.billing.util.callcontext.TenantContext;
 
 public interface RolledUpUsageDao {
 
     void record(UUID subscriptionId, String unitType, DateTime startTime,
                 DateTime endTime, BigDecimal amount, InternalCallContext context);
 
-    RolledUpUsageModelDao getUsageForSubscription(UUID subscriptionId, InternalTenantContext context);
+    RolledUpUsageModelDao getUsageForSubscription(UUID subscriptionId, DateTime startTime, DateTime endTime, String unitType, InternalTenantContext context);
 }
diff --git a/usage/src/main/java/org/killbill/billing/usage/dao/RolledUpUsageSqlDao.java b/usage/src/main/java/org/killbill/billing/usage/dao/RolledUpUsageSqlDao.java
index 29042ca..4bfdb8a 100644
--- a/usage/src/main/java/org/killbill/billing/usage/dao/RolledUpUsageSqlDao.java
+++ b/usage/src/main/java/org/killbill/billing/usage/dao/RolledUpUsageSqlDao.java
@@ -16,6 +16,8 @@
 
 package org.killbill.billing.usage.dao;
 
+import java.math.BigDecimal;
+import java.util.Date;
 import java.util.UUID;
 
 import org.skife.jdbi.v2.sqlobject.Bind;
@@ -36,6 +38,9 @@ public interface RolledUpUsageSqlDao {
                        @InternalTenantContextBinder final InternalCallContext context);
 
     @SqlQuery
-    public RolledUpUsageModelDao getUsageForSubscription(@Bind("subscriptionId") final UUID subscriptionId,
+    public BigDecimal getUsageForSubscription(@Bind("subscriptionId") final UUID subscriptionId,
+                                                         @Bind("startTime") final Date startTime,
+                                                         @Bind("endTime") final Date endTime,
+                                                         @Bind("unitType") final String unitType,
                                                          @InternalTenantContextBinder final InternalTenantContext context);
 }
diff --git a/usage/src/main/resources/org/killbill/billing/usage/dao/RolledUpUsageSqlDao.sql.stg b/usage/src/main/resources/org/killbill/billing/usage/dao/RolledUpUsageSqlDao.sql.stg
index e028757..431d976 100644
--- a/usage/src/main/resources/org/killbill/billing/usage/dao/RolledUpUsageSqlDao.sql.stg
+++ b/usage/src/main/resources/org/killbill/billing/usage/dao/RolledUpUsageSqlDao.sql.stg
@@ -1,6 +1,6 @@
-group RolledUpUsageSqlDao;
+group RolledUpUsageSqlDao: EntitySqlDao;
 
-tableName() ::= "usage"
+tableName() ::= "rolled_up_usage"
 
 tableFields(prefix) ::= <<
   <prefix>id
@@ -43,9 +43,13 @@ values (
 
 getUsageForSubscription() ::= <<
 select
-  <tableFields("t.")>
+  sum(amount)
 from <tableName()> t
 where subscription_id = :subscriptionId
+and start_time >= :startTime
+and end_time \<= :endTime
+and unit_type = :unitType
 <AND_CHECK_TENANT()>
 ;
 >>
+
diff --git a/usage/src/main/resources/org/killbill/billing/usage/ddl.sql b/usage/src/main/resources/org/killbill/billing/usage/ddl.sql
index aa1bd96..2d8edc9 100644
--- a/usage/src/main/resources/org/killbill/billing/usage/ddl.sql
+++ b/usage/src/main/resources/org/killbill/billing/usage/ddl.sql
@@ -6,9 +6,9 @@ CREATE TABLE rolled_up_usage (
     id char(36) NOT NULL,
     subscription_id char(36),
     unit_type varchar(50),
-    start_date date NOT NULL,
-    end_date date,
-    amount numeric(10,10) NOT NULL,
+    start_time datetime NOT NULL,
+    end_time datetime,
+    amount decimal(15,9) NOT NULL,
     created_by varchar(50) NOT NULL,
     created_date datetime NOT NULL,
     account_record_id int(11) unsigned default null,
diff --git a/usage/src/test/java/org/killbill/billing/usage/api/user/MockUsageUserApi.java b/usage/src/test/java/org/killbill/billing/usage/api/user/MockUsageUserApi.java
new file mode 100644
index 0000000..d3dd47a
--- /dev/null
+++ b/usage/src/test/java/org/killbill/billing/usage/api/user/MockUsageUserApi.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * The Billing Project licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.usage.api.user;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import org.joda.time.DateTime;
+import org.killbill.billing.usage.api.RolledUpUsage;
+import org.killbill.billing.usage.api.UsageUserApi;
+import org.killbill.billing.util.callcontext.CallContext;
+import org.killbill.billing.util.callcontext.TenantContext;
+
+
+public class MockUsageUserApi implements UsageUserApi {
+
+    private List<RolledUpUsage> result;
+
+    @Override
+    public void recordRolledUpUsage(final UUID uuid, final String s, final DateTime dateTime, final DateTime dateTime2, final BigDecimal bigDecimal, final CallContext callContext) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public RolledUpUsage getUsageForSubscription(final UUID uuid, final String s, final DateTime dateTime, final DateTime dateTime2, final TenantContext tenantContext) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public List<RolledUpUsage> getAllUsageForSubscription(final UUID uuid, final Set<String> strings, final List<DateTime> dateTimes, final TenantContext tenantContext) {
+        return result;
+    }
+
+    public void setAllUsageForSubscription(final List<RolledUpUsage> result) {
+        this.result = result;
+    }
+}
diff --git a/usage/src/test/java/org/killbill/billing/usage/dao/TestDefaultRolledUpUsageDao.java b/usage/src/test/java/org/killbill/billing/usage/dao/TestDefaultRolledUpUsageDao.java
new file mode 100644
index 0000000..fad80b4
--- /dev/null
+++ b/usage/src/test/java/org/killbill/billing/usage/dao/TestDefaultRolledUpUsageDao.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2014 The Billing Project, LLC
+ *
+ * The Billing Project licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.killbill.billing.usage.dao;
+
+import java.math.BigDecimal;
+import java.util.UUID;
+
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.killbill.billing.usage.UsageTestSuiteWithEmbeddedDB;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+
+public class TestDefaultRolledUpUsageDao extends UsageTestSuiteWithEmbeddedDB {
+
+    @BeforeMethod(groups = "slow")
+    public void setUp() throws Exception {
+    }
+
+    @Test(groups = "slow")
+    public void testSimple() {
+        final UUID subscriptionId = UUID.randomUUID();
+        final String unitType = "foo";
+        final DateTime startDate = new DateTime(2013, 1, 1, 0, 0, DateTimeZone.UTC);
+        final DateTime endDate = new DateTime(2013, 2, 1, 0, 0, DateTimeZone.UTC);
+        final BigDecimal amount1 = BigDecimal.TEN;
+        final BigDecimal amount2 = BigDecimal.TEN;
+
+        rolledUpUsageDao.record(subscriptionId, unitType, startDate, endDate, amount1, internalCallContext);
+        rolledUpUsageDao.record(subscriptionId, unitType, startDate, endDate, amount2, internalCallContext);
+
+        final RolledUpUsageModelDao result = rolledUpUsageDao.getUsageForSubscription(subscriptionId, startDate, endDate, unitType, internalCallContext);
+        assertEquals(result.getSubscriptionId(), subscriptionId);
+        assertEquals(result.getStartTime().compareTo(startDate), 0);
+        assertEquals(result.getEndTime().compareTo(endDate), 0);
+        assertEquals(result.getUnitType(), unitType);
+        assertEquals(result.getSubscriptionId(), subscriptionId);
+        assertEquals(result.getSubscriptionId(), subscriptionId);
+        assertEquals(result.getAmount().compareTo(amount1.add(amount2)), 0);
+    }
+
+    @Test(groups = "slow")
+    public void testNoEntries() {
+        final UUID subscriptionId = UUID.randomUUID();
+        final String unitType = "foo";
+        final DateTime startDate = new DateTime(2013, 1, 1, 0, 0, DateTimeZone.UTC);
+        final DateTime endDate = new DateTime(2013, 2, 1, 0, 0, DateTimeZone.UTC);
+
+        final RolledUpUsageModelDao result = rolledUpUsageDao.getUsageForSubscription(subscriptionId, startDate, endDate, unitType, internalCallContext);
+        assertEquals(result.getSubscriptionId(), subscriptionId);
+        assertEquals(result.getStartTime().compareTo(startDate), 0);
+        assertEquals(result.getEndTime().compareTo(endDate), 0);
+        assertEquals(result.getUnitType(), unitType);
+        assertEquals(result.getSubscriptionId(), subscriptionId);
+        assertEquals(result.getSubscriptionId(), subscriptionId);
+        assertEquals(result.getAmount().compareTo(BigDecimal.ZERO), 0);
+    }
+
+}
diff --git a/usage/src/test/java/org/killbill/billing/usage/glue/TestUsageModule.java b/usage/src/test/java/org/killbill/billing/usage/glue/TestUsageModule.java
index c03237d..8ea3749 100644
--- a/usage/src/test/java/org/killbill/billing/usage/glue/TestUsageModule.java
+++ b/usage/src/test/java/org/killbill/billing/usage/glue/TestUsageModule.java
@@ -16,6 +16,8 @@
 
 package org.killbill.billing.usage.glue;
 
+import org.killbill.billing.usage.api.UsageUserApi;
+import org.killbill.billing.usage.api.user.MockUsageUserApi;
 import org.skife.config.ConfigSource;
 
 public class TestUsageModule extends UsageModule {
@@ -28,4 +30,10 @@ public class TestUsageModule extends UsageModule {
     protected void configure() {
         super.configure();
     }
+
+    protected void installUsageUserApi() {
+        bind(MockUsageUserApi.class).asEagerSingleton();
+        bind(UsageUserApi.class).to(MockUsageUserApi.class).asEagerSingleton();
+    }
+
 }
diff --git a/usage/src/test/java/org/killbill/billing/usage/UsageTestSuiteWithEmbeddedDB.java b/usage/src/test/java/org/killbill/billing/usage/UsageTestSuiteWithEmbeddedDB.java
index 9126e99..9ab15ff 100644
--- a/usage/src/test/java/org/killbill/billing/usage/UsageTestSuiteWithEmbeddedDB.java
+++ b/usage/src/test/java/org/killbill/billing/usage/UsageTestSuiteWithEmbeddedDB.java
@@ -16,6 +16,9 @@
 
 package org.killbill.billing.usage;
 
+import javax.inject.Inject;
+
+import org.killbill.billing.usage.dao.RolledUpUsageDao;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
@@ -28,6 +31,9 @@ import com.google.inject.Injector;
 
 public class UsageTestSuiteWithEmbeddedDB extends GuicyKillbillTestSuiteWithEmbeddedDB {
 
+    @Inject
+    protected RolledUpUsageDao rolledUpUsageDao;
+
     @BeforeClass(groups = "slow")
     protected void beforeClass() throws Exception {
         final Injector injector = Guice.createInjector(new TestUsageModuleWithEmbeddedDB(configSource));
diff --git a/util/src/main/java/org/killbill/billing/util/config/catalog/UriAccessor.java b/util/src/main/java/org/killbill/billing/util/config/catalog/UriAccessor.java
index 5b200a3..3b74562 100644
--- a/util/src/main/java/org/killbill/billing/util/config/catalog/UriAccessor.java
+++ b/util/src/main/java/org/killbill/billing/util/config/catalog/UriAccessor.java
@@ -23,11 +23,14 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Scanner;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
 
 import com.google.common.io.Resources;
 
 public class UriAccessor {
 
+    private static final String URI_SCHEME_FOR_ARCHIVE_FILE = "jar:file";
     private static final String URI_SCHEME_FOR_CLASSPATH = "jar";
     private static final String URI_SCHEME_FOR_FILE = "file";
 
@@ -42,7 +45,11 @@ public class UriAccessor {
         if (scheme == null) {
             uri = new URI(Resources.getResource(uri.toString()).toExternalForm());
         } else if (scheme.equals(URI_SCHEME_FOR_CLASSPATH)) {
-            return UriAccessor.class.getResourceAsStream(uri.getPath());
+            if (uri.toString().startsWith(URI_SCHEME_FOR_ARCHIVE_FILE)) {
+                return getInputStreamFromJarFile(uri.toString());
+            } else {
+                return UriAccessor.class.getResourceAsStream(uri.getPath());
+            }
         } else if (scheme.equals(URI_SCHEME_FOR_FILE) &&
                    !uri.getSchemeSpecificPart().startsWith("/")) { // interpret URIs of this form as relative path uris
             uri = new File(uri.getSchemeSpecificPart()).toURI();
@@ -51,6 +58,23 @@ public class UriAccessor {
         return url.openConnection().getInputStream();
     }
 
+    /**
+     *
+     * @param classPathFile of the form jar:file:/path!/resource
+     * @return
+     * @throws IOException if fail to extract InputStream
+     */
+    private static InputStream getInputStreamFromJarFile(final String classPathFile) throws IOException {
+
+        final String[] partsPathAndResource = classPathFile.split("!");
+        final String resourceInJar = partsPathAndResource[1].substring(1);
+
+        final String[] partsColumns = partsPathAndResource[0].split(":");
+        final String jarFileName = partsColumns[2];
+
+        return new ZipFile(new File(jarFileName)).getInputStream(new ZipEntry(resourceInJar));
+    }
+
     public static String accessUriAsString(final String uri) throws IOException, URISyntaxException {
         return accessUriAsString(new URI(uri));
     }
diff --git a/util/src/main/java/org/killbill/billing/util/config/catalog/ValidatingConfig.java b/util/src/main/java/org/killbill/billing/util/config/catalog/ValidatingConfig.java
index dc9ad83..8278117 100644
--- a/util/src/main/java/org/killbill/billing/util/config/catalog/ValidatingConfig.java
+++ b/util/src/main/java/org/killbill/billing/util/config/catalog/ValidatingConfig.java
@@ -17,6 +17,7 @@
 package org.killbill.billing.util.config.catalog;
 
 import java.net.URI;
+import java.util.Collection;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -41,4 +42,11 @@ public abstract class ValidatingConfig<Context> {
     public void initialize(final Context root, final URI uri) {
     }
 
+    protected Collection<? extends ValidationError> validateCollection(final Context context,
+                                                                       final ValidationErrors errors, final ValidatingConfig<Context>[] configs) {
+        for (final ValidatingConfig<Context> config : configs) {
+            config.validate(context, errors);
+        }
+        return errors;
+    }
 }
diff --git a/util/src/main/java/org/killbill/billing/util/timezone/DateAndTimeZoneContext.java b/util/src/main/java/org/killbill/billing/util/timezone/DateAndTimeZoneContext.java
index 872f0e5..54fec5d 100644
--- a/util/src/main/java/org/killbill/billing/util/timezone/DateAndTimeZoneContext.java
+++ b/util/src/main/java/org/killbill/billing/util/timezone/DateAndTimeZoneContext.java
@@ -59,7 +59,7 @@ public final class DateAndTimeZoneContext {
         // Since we create the targetDate for next invoice using the date from the notificationQ, we need to make sure
         // that this datetime once transformed into a LocalDate points to the correct day.
         //
-        // All we need to do is figure is the transformation from DateTime (point in time) to LocalDate (date in account time zone)
+        // All we need to do is figure if the transformation from DateTime (point in time) to LocalDate (date in account time zone)
         // changed the day; if so, when we recompute a UTC date from LocalDate (date in account time zone), we can simply chose a reference
         // time and apply the offset backward to end up on the right day
         //
diff --git a/util/src/test/java/org/killbill/billing/mock/MockPlan.java b/util/src/test/java/org/killbill/billing/mock/MockPlan.java
index 2317781..a5e03ec 100644
--- a/util/src/test/java/org/killbill/billing/mock/MockPlan.java
+++ b/util/src/test/java/org/killbill/billing/mock/MockPlan.java
@@ -73,7 +73,7 @@ public class MockPlan implements Plan {
     }
 
     @Override
-    public BillingPeriod getBillingPeriod() {
+    public BillingPeriod getRecurringBillingPeriod() {
         throw new UnsupportedOperationException();
     }