killbill-memoizeit

Changes

account/src/main/java/com/ning/billing/account/api/DefaultBillCycleDay.java 89(+0 -89)

api/src/main/java/com/ning/billing/account/api/BillCycleDay.java 27(+0 -27)

catalog/pom.xml 26(+26 -0)

jaxrs/src/main/java/com/ning/billing/jaxrs/json/BillCycleDayJson.java 76(+0 -76)

server/src/test/java/com/ning/billing/server/ServerTestSuiteWithEmbeddedDB.java 22(+0 -22)

util/src/test/java/com/ning/billing/mock/api/MockBillCycleDay.java 64(+0 -64)

Details

diff --git a/account/src/main/java/com/ning/billing/account/api/DefaultAccount.java b/account/src/main/java/com/ning/billing/account/api/DefaultAccount.java
index 7bdb0f1..26eb1e1 100644
--- a/account/src/main/java/com/ning/billing/account/api/DefaultAccount.java
+++ b/account/src/main/java/com/ning/billing/account/api/DefaultAccount.java
@@ -38,7 +38,6 @@ public class DefaultAccount extends EntityBase implements Account {
     // some fields
     public static final String DEFAULT_STRING_VALUE = "";
     public static final Integer DEFAULT_INTEGER_VALUE = 0;
-    public static final BillCycleDay DEFAULT_BCD_VALUE = new DefaultBillCycleDay(DEFAULT_INTEGER_VALUE);
     public static final Currency DEFAULT_CURRENCY_VALUE = Currency.USD;
     public static final DateTimeZone DEFAULT_TIMEZONE_VALUE = DateTimeZone.UTC;
     private static final Boolean DEFAULT_MIGRATED_VALUE = true;
@@ -49,7 +48,7 @@ public class DefaultAccount extends EntityBase implements Account {
     private final String name;
     private final Integer firstNameLength;
     private final Currency currency;
-    private final BillCycleDay billCycleDay;
+    private final Integer billCycleDayLocal;
     private final UUID paymentMethodId;
     private final DateTimeZone timeZone;
     private final String locale;
@@ -72,7 +71,7 @@ public class DefaultAccount extends EntityBase implements Account {
      */
     public DefaultAccount(final UUID id, final AccountData data) {
         this(id, data.getExternalKey(), data.getEmail(), data.getName(), data.getFirstNameLength(),
-             data.getCurrency(), data.getBillCycleDay(), data.getPaymentMethodId(),
+             data.getCurrency(), data.getBillCycleDayLocal(), data.getPaymentMethodId(),
              data.getTimeZone(), data.getLocale(),
              data.getAddress1(), data.getAddress2(), data.getCompanyName(),
              data.getCity(), data.getStateOrProvince(), data.getCountry(),
@@ -84,13 +83,13 @@ public class DefaultAccount extends EntityBase implements Account {
     */
     public DefaultAccount(final UUID id, final String externalKey, final String email,
                           final String name, final Integer firstNameLength,
-                          final Currency currency, final BillCycleDay billCycleDay, final UUID paymentMethodId,
+                          final Currency currency, final int billCycleDayLocal, final UUID paymentMethodId,
                           final DateTimeZone timeZone, final String locale,
                           final String address1, final String address2, final String companyName,
                           final String city, final String stateOrProvince, final String country,
                           final String postalCode, final String phone,
                           final Boolean isMigrated, final Boolean isNotifiedForInvoices) {
-        this(id, null, null, externalKey, email, name, firstNameLength, currency, billCycleDay, paymentMethodId,
+        this(id, null, null, externalKey, email, name, firstNameLength, currency, billCycleDayLocal, paymentMethodId,
              timeZone, locale, address1, address2, companyName, city, stateOrProvince, country, postalCode,
              phone, isMigrated, isNotifiedForInvoices);
     }
@@ -98,7 +97,7 @@ public class DefaultAccount extends EntityBase implements Account {
     public DefaultAccount(final UUID id, @Nullable final DateTime createdDate, @Nullable final DateTime updatedDate,
                           final String externalKey, final String email,
                           final String name, final Integer firstNameLength,
-                          final Currency currency, final BillCycleDay billCycleDay, final UUID paymentMethodId,
+                          final Currency currency, final int billCycleDayLocal, final UUID paymentMethodId,
                           final DateTimeZone timeZone, final String locale,
                           final String address1, final String address2, final String companyName,
                           final String city, final String stateOrProvince, final String country,
@@ -110,7 +109,7 @@ public class DefaultAccount extends EntityBase implements Account {
         this.name = name;
         this.firstNameLength = firstNameLength;
         this.currency = currency;
-        this.billCycleDay = billCycleDay;
+        this.billCycleDayLocal = billCycleDayLocal;
         this.paymentMethodId = paymentMethodId;
         this.timeZone = timeZone;
         this.locale = locale;
@@ -129,7 +128,7 @@ public class DefaultAccount extends EntityBase implements Account {
     public DefaultAccount(final AccountModelDao accountModelDao) {
         this(accountModelDao.getId(), accountModelDao.getCreatedDate(), accountModelDao.getUpdatedDate(), accountModelDao.getExternalKey(),
              accountModelDao.getEmail(), accountModelDao.getName(), accountModelDao.getFirstNameLength(), accountModelDao.getCurrency(),
-             new DefaultBillCycleDay(accountModelDao.getBillingCycleDayLocal(), accountModelDao.getBillingCycleDayUtc()), accountModelDao.getPaymentMethodId(),
+             accountModelDao.getBillingCycleDayLocal(), accountModelDao.getPaymentMethodId(),
              accountModelDao.getTimeZone(), accountModelDao.getLocale(), accountModelDao.getAddress1(), accountModelDao.getAddress2(),
              accountModelDao.getCompanyName(), accountModelDao.getCity(), accountModelDao.getStateOrProvince(), accountModelDao.getCountry(),
              accountModelDao.getPostalCode(), accountModelDao.getPhone(), accountModelDao.getMigrated(), accountModelDao.getIsNotifiedForInvoices());
@@ -161,8 +160,8 @@ public class DefaultAccount extends EntityBase implements Account {
     }
 
     @Override
-    public BillCycleDay getBillCycleDay() {
-        return Objects.firstNonNull(billCycleDay, DEFAULT_BCD_VALUE);
+    public Integer getBillCycleDayLocal() {
+        return Objects.firstNonNull(billCycleDayLocal, DEFAULT_INTEGER_VALUE);
     }
 
     @Override
@@ -260,19 +259,15 @@ public class DefaultAccount extends EntityBase implements Account {
             accountData.setCurrency(currentAccount.getCurrency());
         }
 
-        if (billCycleDay != null && currentAccount.getBillCycleDay() != null && currentAccount.getBillCycleDay().getDayOfMonthLocal() != 0 && currentAccount.getBillCycleDay().getDayOfMonthUTC() != 0) {
-            // We can't just use .equals here as the BillCycleDay class might not have implemented it
-            if ((billCycleDay.getDayOfMonthUTC() != currentAccount.getBillCycleDay().getDayOfMonthUTC() ||
-                 billCycleDay.getDayOfMonthLocal() != currentAccount.getBillCycleDay().getDayOfMonthLocal())) {
-                throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account BCD yet: new=%s, current=%s",
-                                                                 billCycleDay, currentAccount.getBillCycleDay()));
-            }
-        } else if (billCycleDay != null) {
+        if (billCycleDayLocal != null && billCycleDayLocal != 0 && currentAccount.getBillCycleDayLocal() != 0 && !billCycleDayLocal.equals(currentAccount.getBillCycleDayLocal())) {
+            throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account BCD yet: new=%s, current=%s",
+                                                             billCycleDayLocal, currentAccount.getBillCycleDayLocal()));
+        } else if (billCycleDayLocal != null && billCycleDayLocal != 0) {
             // Junction sets it
-            accountData.setBillCycleDay(billCycleDay);
+            accountData.setBillCycleDayLocal(billCycleDayLocal);
         } else {
             // Default to current value
-            accountData.setBillCycleDay(currentAccount.getBillCycleDay());
+            accountData.setBillCycleDayLocal(currentAccount.getBillCycleDayLocal());
         }
 
         // Set all updatable fields with the new values if non null, otherwise defaults to the current values
@@ -305,7 +300,7 @@ public class DefaultAccount extends EntityBase implements Account {
                ", firstNameLength=" + firstNameLength +
                ", phone=" + phone +
                ", currency=" + currency +
-               ", billCycleDay=" + billCycleDay +
+               ", billCycleDayLocal=" + billCycleDayLocal +
                ", paymentMethodId=" + paymentMethodId +
                ", timezone=" + timeZone +
                ", locale=" + locale +
@@ -327,16 +322,19 @@ public class DefaultAccount extends EntityBase implements Account {
         if (o == null || getClass() != o.getClass()) {
             return false;
         }
+        if (!super.equals(o)) {
+            return false;
+        }
 
         final DefaultAccount that = (DefaultAccount) o;
 
-        if (address1 != null ? !address1.equals(that.address1) : that.address1 != null) {
+        if (!billCycleDayLocal.equals(that.billCycleDayLocal)) {
             return false;
         }
-        if (address2 != null ? !address2.equals(that.address2) : that.address2 != null) {
+        if (address1 != null ? !address1.equals(that.address1) : that.address1 != null) {
             return false;
         }
-        if (billCycleDay != null ? !billCycleDay.equals(that.billCycleDay) : that.billCycleDay != null) {
+        if (address2 != null ? !address2.equals(that.address2) : that.address2 != null) {
             return false;
         }
         if (city != null ? !city.equals(that.city) : that.city != null) {
@@ -393,12 +391,13 @@ public class DefaultAccount extends EntityBase implements Account {
 
     @Override
     public int hashCode() {
-        int result = externalKey != null ? externalKey.hashCode() : 0;
+        int result = super.hashCode();
+        result = 31 * result + (externalKey != null ? externalKey.hashCode() : 0);
         result = 31 * result + (email != null ? email.hashCode() : 0);
         result = 31 * result + (name != null ? name.hashCode() : 0);
         result = 31 * result + (firstNameLength != null ? firstNameLength.hashCode() : 0);
         result = 31 * result + (currency != null ? currency.hashCode() : 0);
-        result = 31 * result + (billCycleDay != null ? billCycleDay.hashCode() : 0);
+        result = 31 * result + billCycleDayLocal;
         result = 31 * result + (paymentMethodId != null ? paymentMethodId.hashCode() : 0);
         result = 31 * result + (timeZone != null ? timeZone.hashCode() : 0);
         result = 31 * result + (locale != null ? locale.hashCode() : 0);
diff --git a/account/src/main/java/com/ning/billing/account/api/user/DefaultAccountChangeEvent.java b/account/src/main/java/com/ning/billing/account/api/user/DefaultAccountChangeEvent.java
index 5c92e84..45f7372 100644
--- a/account/src/main/java/com/ning/billing/account/api/user/DefaultAccountChangeEvent.java
+++ b/account/src/main/java/com/ning/billing/account/api/user/DefaultAccountChangeEvent.java
@@ -155,10 +155,6 @@ public class DefaultAccountChangeEvent extends DefaultBusInternalEvent implement
                           "billCycleDayLocal",
                           String.valueOf(oldData.getBillingCycleDayLocal()), String.valueOf(newData.getBillingCycleDayLocal()));
 
-        addIfValueChanged(tmpChangedFields,
-                          "billCycleDayUTC",
-                          String.valueOf(oldData.getBillingCycleDayUtc()), String.valueOf(newData.getBillingCycleDayUtc()));
-
         addIfValueChanged(tmpChangedFields, "paymentMethodId",
                           (oldData.getPaymentMethodId() != null) ? oldData.getPaymentMethodId().toString() : null,
                           (newData.getPaymentMethodId() != null) ? newData.getPaymentMethodId().toString() : null);
diff --git a/account/src/main/java/com/ning/billing/account/api/user/DefaultAccountCreationEvent.java b/account/src/main/java/com/ning/billing/account/api/user/DefaultAccountCreationEvent.java
index 5b68254..933fb64 100644
--- a/account/src/main/java/com/ning/billing/account/api/user/DefaultAccountCreationEvent.java
+++ b/account/src/main/java/com/ning/billing/account/api/user/DefaultAccountCreationEvent.java
@@ -21,8 +21,6 @@ import java.util.UUID;
 import org.joda.time.DateTimeZone;
 
 import com.ning.billing.account.api.AccountData;
-import com.ning.billing.account.api.BillCycleDay;
-import com.ning.billing.account.api.DefaultBillCycleDay;
 import com.ning.billing.account.dao.AccountModelDao;
 import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.util.events.AccountCreationInternalEvent;
@@ -114,7 +112,7 @@ public class DefaultAccountCreationEvent extends DefaultBusInternalEvent impleme
         private final String name;
         private final Integer firstNameLength;
         private final String email;
-        private final DefaultBillCycleDay billCycleDay;
+        private final int billCycleDayLocal;
         private final String currency;
         private final UUID paymentMethodId;
         private final String timeZone;
@@ -135,7 +133,7 @@ public class DefaultAccountCreationEvent extends DefaultBusInternalEvent impleme
                  d.getName(),
                  d.getFirstNameLength(),
                  d.getEmail(),
-                 new DefaultBillCycleDay(d.getBillingCycleDayLocal(), d.getBillingCycleDayUtc()),
+                 d.getBillingCycleDayLocal(),
                  d.getCurrency() != null ? d.getCurrency().name() : null,
                  d.getPaymentMethodId(),
                  d.getTimeZone() != null ? d.getTimeZone().getID() : null,
@@ -157,7 +155,7 @@ public class DefaultAccountCreationEvent extends DefaultBusInternalEvent impleme
                                   @JsonProperty("name") final String name,
                                   @JsonProperty("firstNameLength") final Integer firstNameLength,
                                   @JsonProperty("email") final String email,
-                                  @JsonProperty("billCycleDay") final DefaultBillCycleDay billCycleDay,
+                                  @JsonProperty("billCycleDayLocal") final int billCycleDayLocal,
                                   @JsonProperty("currency") final String currency,
                                   @JsonProperty("paymentMethodId") final UUID paymentMethodId,
                                   @JsonProperty("timeZone") final String timeZone,
@@ -172,12 +170,11 @@ public class DefaultAccountCreationEvent extends DefaultBusInternalEvent impleme
                                   @JsonProperty("phone") final String phone,
                                   @JsonProperty("isMigrated") final boolean isMigrated,
                                   @JsonProperty("isNotifiedForInvoices") final boolean isNotifiedForInvoices) {
-            super();
             this.externalKey = externalKey;
             this.name = name;
             this.firstNameLength = firstNameLength;
             this.email = email;
-            this.billCycleDay = billCycleDay;
+            this.billCycleDayLocal = billCycleDayLocal;
             this.currency = currency;
             this.paymentMethodId = paymentMethodId;
             this.timeZone = timeZone;
@@ -215,8 +212,8 @@ public class DefaultAccountCreationEvent extends DefaultBusInternalEvent impleme
         }
 
         @Override
-        public BillCycleDay getBillCycleDay() {
-            return billCycleDay;
+        public Integer getBillCycleDayLocal() {
+            return billCycleDayLocal;
         }
 
         @Override
@@ -298,180 +295,99 @@ public class DefaultAccountCreationEvent extends DefaultBusInternalEvent impleme
         }
 
         @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result
-                     + ((address1 == null) ? 0 : address1.hashCode());
-            result = prime * result
-                     + ((address2 == null) ? 0 : address2.hashCode());
-            result = prime * result
-                     + ((billCycleDay == null) ? 0 : billCycleDay.hashCode());
-            result = prime * result + ((city == null) ? 0 : city.hashCode());
-            result = prime * result
-                     + ((companyName == null) ? 0 : companyName.hashCode());
-            result = prime * result
-                     + ((country == null) ? 0 : country.hashCode());
-            result = prime * result
-                     + ((currency == null) ? 0 : currency.hashCode());
-            result = prime * result + ((email == null) ? 0 : email.hashCode());
-            result = prime * result
-                     + ((externalKey == null) ? 0 : externalKey.hashCode());
-            result = prime
-                     * result
-                     + ((firstNameLength == null) ? 0 : firstNameLength
-                    .hashCode());
-            result = prime * result
-                     + ((locale == null) ? 0 : locale.hashCode());
-            result = prime * result + ((name == null) ? 0 : name.hashCode());
-            result = prime
-                     * result
-                     + ((paymentMethodId == null) ? 0 : paymentMethodId
-                    .hashCode());
-            result = prime * result + ((phone == null) ? 0 : phone.hashCode());
-            result = prime * result
-                     + ((postalCode == null) ? 0 : postalCode.hashCode());
-            result = prime
-                     * result
-                     + ((stateOrProvince == null) ? 0 : stateOrProvince
-                    .hashCode());
-            result = prime * result
-                     + ((timeZone == null) ? 0 : timeZone.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(final Object obj) {
-            if (this == obj) {
+        public boolean equals(final Object o) {
+            if (this == o) {
                 return true;
             }
-            if (obj == null) {
+            if (o == null || getClass() != o.getClass()) {
                 return false;
             }
-            if (getClass() != obj.getClass()) {
+
+            final DefaultAccountData that = (DefaultAccountData) o;
+
+            if (billCycleDayLocal != that.billCycleDayLocal) {
                 return false;
             }
-            final DefaultAccountData other = (DefaultAccountData) obj;
-            if (address1 == null) {
-                if (other.address1 != null) {
-                    return false;
-                }
-            } else if (!address1.equals(other.address1)) {
+            if (isMigrated != that.isMigrated) {
                 return false;
             }
-            if (address2 == null) {
-                if (other.address2 != null) {
-                    return false;
-                }
-            } else if (!address2.equals(other.address2)) {
+            if (isNotifiedForInvoices != that.isNotifiedForInvoices) {
                 return false;
             }
-            if (billCycleDay == null) {
-                if (other.billCycleDay != null) {
-                    return false;
-                }
-            } else if (!billCycleDay.equals(other.billCycleDay)) {
+            if (address1 != null ? !address1.equals(that.address1) : that.address1 != null) {
                 return false;
             }
-            if (city == null) {
-                if (other.city != null) {
-                    return false;
-                }
-            } else if (!city.equals(other.city)) {
+            if (address2 != null ? !address2.equals(that.address2) : that.address2 != null) {
                 return false;
             }
-            if (companyName == null) {
-                if (other.companyName != null) {
-                    return false;
-                }
-            } else if (!companyName.equals(other.companyName)) {
+            if (city != null ? !city.equals(that.city) : that.city != null) {
                 return false;
             }
-            if (country == null) {
-                if (other.country != null) {
-                    return false;
-                }
-            } else if (!country.equals(other.country)) {
+            if (companyName != null ? !companyName.equals(that.companyName) : that.companyName != null) {
                 return false;
             }
-            if (currency == null) {
-                if (other.currency != null) {
-                    return false;
-                }
-            } else if (!currency.equals(other.currency)) {
+            if (country != null ? !country.equals(that.country) : that.country != null) {
                 return false;
             }
-            if (email == null) {
-                if (other.email != null) {
-                    return false;
-                }
-            } else if (!email.equals(other.email)) {
+            if (currency != null ? !currency.equals(that.currency) : that.currency != null) {
                 return false;
             }
-            if (externalKey == null) {
-                if (other.externalKey != null) {
-                    return false;
-                }
-            } else if (!externalKey.equals(other.externalKey)) {
+            if (email != null ? !email.equals(that.email) : that.email != null) {
                 return false;
             }
-            if (firstNameLength == null) {
-                if (other.firstNameLength != null) {
-                    return false;
-                }
-            } else if (!firstNameLength.equals(other.firstNameLength)) {
+            if (externalKey != null ? !externalKey.equals(that.externalKey) : that.externalKey != null) {
                 return false;
             }
-            if (locale == null) {
-                if (other.locale != null) {
-                    return false;
-                }
-            } else if (!locale.equals(other.locale)) {
+            if (firstNameLength != null ? !firstNameLength.equals(that.firstNameLength) : that.firstNameLength != null) {
                 return false;
             }
-            if (name == null) {
-                if (other.name != null) {
-                    return false;
-                }
-            } else if (!name.equals(other.name)) {
+            if (locale != null ? !locale.equals(that.locale) : that.locale != null) {
                 return false;
             }
-            if (paymentMethodId == null) {
-                if (other.paymentMethodId != null) {
-                    return false;
-                }
-            } else if (!paymentMethodId.equals(other.paymentMethodId)) {
+            if (name != null ? !name.equals(that.name) : that.name != null) {
                 return false;
             }
-            if (phone == null) {
-                if (other.phone != null) {
-                    return false;
-                }
-            } else if (!phone.equals(other.phone)) {
+            if (paymentMethodId != null ? !paymentMethodId.equals(that.paymentMethodId) : that.paymentMethodId != null) {
                 return false;
             }
-            if (postalCode == null) {
-                if (other.postalCode != null) {
-                    return false;
-                }
-            } else if (!postalCode.equals(other.postalCode)) {
+            if (phone != null ? !phone.equals(that.phone) : that.phone != null) {
                 return false;
             }
-            if (stateOrProvince == null) {
-                if (other.stateOrProvince != null) {
-                    return false;
-                }
-            } else if (!stateOrProvince.equals(other.stateOrProvince)) {
+            if (postalCode != null ? !postalCode.equals(that.postalCode) : that.postalCode != null) {
                 return false;
             }
-            if (timeZone == null) {
-                if (other.timeZone != null) {
-                    return false;
-                }
-            } else if (!timeZone.equals(other.timeZone)) {
+            if (stateOrProvince != null ? !stateOrProvince.equals(that.stateOrProvince) : that.stateOrProvince != null) {
                 return false;
             }
+            if (timeZone != null ? !timeZone.equals(that.timeZone) : that.timeZone != null) {
+                return false;
+            }
+
             return true;
         }
+
+        @Override
+        public int hashCode() {
+            int result = externalKey != null ? externalKey.hashCode() : 0;
+            result = 31 * result + (name != null ? name.hashCode() : 0);
+            result = 31 * result + (firstNameLength != null ? firstNameLength.hashCode() : 0);
+            result = 31 * result + (email != null ? email.hashCode() : 0);
+            result = 31 * result + billCycleDayLocal;
+            result = 31 * result + (currency != null ? currency.hashCode() : 0);
+            result = 31 * result + (paymentMethodId != null ? paymentMethodId.hashCode() : 0);
+            result = 31 * result + (timeZone != null ? timeZone.hashCode() : 0);
+            result = 31 * result + (locale != null ? locale.hashCode() : 0);
+            result = 31 * result + (address1 != null ? address1.hashCode() : 0);
+            result = 31 * result + (address2 != null ? address2.hashCode() : 0);
+            result = 31 * result + (companyName != null ? companyName.hashCode() : 0);
+            result = 31 * result + (city != null ? city.hashCode() : 0);
+            result = 31 * result + (stateOrProvince != null ? stateOrProvince.hashCode() : 0);
+            result = 31 * result + (postalCode != null ? postalCode.hashCode() : 0);
+            result = 31 * result + (country != null ? country.hashCode() : 0);
+            result = 31 * result + (phone != null ? phone.hashCode() : 0);
+            result = 31 * result + (isMigrated ? 1 : 0);
+            result = 31 * result + (isNotifiedForInvoices ? 1 : 0);
+            return result;
+        }
     }
 }
diff --git a/account/src/main/java/com/ning/billing/account/dao/AccountModelDao.java b/account/src/main/java/com/ning/billing/account/dao/AccountModelDao.java
index b5a3398..b1961da 100644
--- a/account/src/main/java/com/ning/billing/account/dao/AccountModelDao.java
+++ b/account/src/main/java/com/ning/billing/account/dao/AccountModelDao.java
@@ -38,7 +38,6 @@ public class AccountModelDao extends EntityBase implements EntityModelDao<Accoun
     private Integer firstNameLength;
     private Currency currency;
     private int billingCycleDayLocal;
-    private int billingCycleDayUtc;
     private UUID paymentMethodId;
     private DateTimeZone timeZone;
     private String locale;
@@ -57,7 +56,7 @@ public class AccountModelDao extends EntityBase implements EntityModelDao<Accoun
 
     public AccountModelDao(final UUID id, final DateTime createdDate, final DateTime updatedDate, final String externalKey,
                            final String email, final String name, final Integer firstNameLength, final Currency currency,
-                           final int billingCycleDayLocal, final int billingCycleDayUtc, final UUID paymentMethodId, final DateTimeZone timeZone,
+                           final int billingCycleDayLocal, final UUID paymentMethodId, final DateTimeZone timeZone,
                            final String locale, final String address1, final String address2, final String companyName,
                            final String city, final String stateOrProvince, final String country, final String postalCode,
                            final String phone, final Boolean migrated, final Boolean notifiedForInvoices) {
@@ -68,7 +67,6 @@ public class AccountModelDao extends EntityBase implements EntityModelDao<Accoun
         this.firstNameLength = firstNameLength;
         this.currency = currency;
         this.billingCycleDayLocal = billingCycleDayLocal;
-        this.billingCycleDayUtc = billingCycleDayUtc;
         this.paymentMethodId = paymentMethodId;
         this.timeZone = timeZone;
         this.locale = locale;
@@ -86,8 +84,8 @@ public class AccountModelDao extends EntityBase implements EntityModelDao<Accoun
 
     public AccountModelDao(final UUID id, @Nullable final DateTime createdDate, final DateTime updatedDate, final AccountData account) {
         this(id, createdDate, updatedDate, account.getExternalKey(),
-             account.getEmail(), account.getName(), account.getFirstNameLength(), account.getCurrency(), account.getBillCycleDay() == null ? 0 : account.getBillCycleDay().getDayOfMonthLocal(),
-             account.getBillCycleDay() == null ? 0 : account.getBillCycleDay().getDayOfMonthUTC(), account.getPaymentMethodId(), account.getTimeZone(), account.getLocale(), account.getAddress1(), account.getAddress2(),
+             account.getEmail(), account.getName(), account.getFirstNameLength(), account.getCurrency(),
+             account.getBillCycleDayLocal() == null ? 0 : account.getBillCycleDayLocal(), account.getPaymentMethodId(), account.getTimeZone(), account.getLocale(), account.getAddress1(), account.getAddress2(),
              account.getCompanyName(), account.getCity(), account.getStateOrProvince(), account.getCountry(), account.getPostalCode(),
              account.getPhone(), account.isMigrated(), account.isNotifiedForInvoices());
     }
@@ -120,14 +118,10 @@ public class AccountModelDao extends EntityBase implements EntityModelDao<Accoun
         return currency;
     }
 
-    public int getBillingCycleDayLocal() {
+    public Integer getBillingCycleDayLocal() {
         return billingCycleDayLocal;
     }
 
-    public int getBillingCycleDayUtc() {
-        return billingCycleDayUtc;
-    }
-
     public UUID getPaymentMethodId() {
         return paymentMethodId;
     }
@@ -192,7 +186,6 @@ public class AccountModelDao extends EntityBase implements EntityModelDao<Accoun
         sb.append(", firstNameLength=").append(firstNameLength);
         sb.append(", currency=").append(currency);
         sb.append(", billingCycleDayLocal=").append(billingCycleDayLocal);
-        sb.append(", billingCycleDayUTC=").append(billingCycleDayUtc);
         sb.append(", paymentMethodId=").append(paymentMethodId);
         sb.append(", timeZone=").append(timeZone);
         sb.append(", locale='").append(locale).append('\'');
@@ -227,9 +220,6 @@ public class AccountModelDao extends EntityBase implements EntityModelDao<Accoun
         if (billingCycleDayLocal != that.billingCycleDayLocal) {
             return false;
         }
-        if (billingCycleDayUtc != that.billingCycleDayUtc) {
-            return false;
-        }
         if (address1 != null ? !address1.equals(that.address1) : that.address1 != null) {
             return false;
         }
@@ -297,7 +287,6 @@ public class AccountModelDao extends EntityBase implements EntityModelDao<Accoun
         result = 31 * result + (firstNameLength != null ? firstNameLength.hashCode() : 0);
         result = 31 * result + (currency != null ? currency.hashCode() : 0);
         result = 31 * result + billingCycleDayLocal;
-        result = 31 * result + billingCycleDayUtc;
         result = 31 * result + (paymentMethodId != null ? paymentMethodId.hashCode() : 0);
         result = 31 * result + (timeZone != null ? timeZone.hashCode() : 0);
         result = 31 * result + (locale != null ? locale.hashCode() : 0);
diff --git a/account/src/main/resources/com/ning/billing/account/dao/AccountSqlDao.sql.stg b/account/src/main/resources/com/ning/billing/account/dao/AccountSqlDao.sql.stg
index 7a61009..5ed297b 100644
--- a/account/src/main/resources/com/ning/billing/account/dao/AccountSqlDao.sql.stg
+++ b/account/src/main/resources/com/ning/billing/account/dao/AccountSqlDao.sql.stg
@@ -11,7 +11,6 @@ tableFields(prefix) ::= <<
 , <prefix>first_name_length
 , <prefix>currency
 , <prefix>billing_cycle_day_local
-, <prefix>billing_cycle_day_utc
 , <prefix>payment_method_id
 , <prefix>time_zone
 , <prefix>locale
@@ -38,7 +37,6 @@ tableValues() ::= <<
 , :firstNameLength
 , :currency
 , :billingCycleDayLocal
-, :billingCycleDayUtc
 , :paymentMethodId
 , :timeZone
 , :locale
@@ -65,7 +63,7 @@ accountRecordIdValueWithComma(prefix) ::= ""
 update() ::= <<
     UPDATE accounts
     SET email = :email, name = :name, first_name_length = :firstNameLength,
-        currency = :currency, billing_cycle_day_local = :billingCycleDayLocal, billing_cycle_day_utc = :billingCycleDayUtc,
+        currency = :currency, billing_cycle_day_local = :billingCycleDayLocal,
         payment_method_id = :paymentMethodId, time_zone = :timeZone, locale = :locale,
         address1 = :address1, address2 = :address2, company_name = :companyName, city = :city, state_or_province = :stateOrProvince,
         country = :country, postal_code = :postalCode, phone = :phone,
diff --git a/account/src/test/java/com/ning/billing/account/AccountTestUtils.java b/account/src/test/java/com/ning/billing/account/AccountTestUtils.java
index b451f8e..8db3b28 100644
--- a/account/src/test/java/com/ning/billing/account/AccountTestUtils.java
+++ b/account/src/test/java/com/ning/billing/account/AccountTestUtils.java
@@ -23,8 +23,6 @@ import org.joda.time.DateTimeZone;
 import org.testng.Assert;
 
 import com.ning.billing.account.api.AccountData;
-import com.ning.billing.account.api.BillCycleDay;
-import com.ning.billing.account.api.DefaultBillCycleDay;
 import com.ning.billing.account.api.DefaultMutableAccountData;
 import com.ning.billing.account.dao.AccountModelDao;
 import com.ning.billing.catalog.api.Currency;
@@ -51,7 +49,6 @@ public abstract class AccountTestUtils {
         Assert.assertEquals(retrievedAccount.getFirstNameLength(), account.getFirstNameLength());
         Assert.assertEquals(retrievedAccount.getCurrency(), account.getCurrency());
         Assert.assertEquals(retrievedAccount.getBillingCycleDayLocal(), account.getBillingCycleDayLocal());
-        Assert.assertEquals(retrievedAccount.getBillingCycleDayUtc(), account.getBillingCycleDayUtc());
         Assert.assertEquals(retrievedAccount.getPaymentMethodId(), account.getPaymentMethodId());
         Assert.assertEquals(retrievedAccount.getTimeZone(), account.getTimeZone());
         Assert.assertEquals(retrievedAccount.getLocale(), account.getLocale());
@@ -96,7 +93,6 @@ public abstract class AccountTestUtils {
         final DateTimeZone timeZone = DateTimeZone.forID("America/Los_Angeles");
         final int firstNameLength = name.length();
         final Currency currency = Currency.MXN;
-        final BillCycleDay billCycleDay = new DefaultBillCycleDay(billCycleDayLocal, billCycleDayUTC);
         final UUID paymentMethodId = UUID.randomUUID();
         final String address1 = UUID.randomUUID().toString();
         final String address2 = UUID.randomUUID().toString();
@@ -107,7 +103,7 @@ public abstract class AccountTestUtils {
         final String postalCode = UUID.randomUUID().toString().substring(0, 4);
 
         return new DefaultMutableAccountData(externalKey, email, name, firstNameLength, currency,
-                                             billCycleDay, paymentMethodId, timeZone,
+                                             billCycleDayLocal, paymentMethodId, timeZone,
                                              locale, address1, address2, companyName, city, stateOrProvince,
                                              country, postalCode, phone, false, true);
     }
diff --git a/account/src/test/java/com/ning/billing/account/api/user/TestDefaultAccountUserApi.java b/account/src/test/java/com/ning/billing/account/api/user/TestDefaultAccountUserApi.java
index 1f7d920..0c44818 100644
--- a/account/src/test/java/com/ning/billing/account/api/user/TestDefaultAccountUserApi.java
+++ b/account/src/test/java/com/ning/billing/account/api/user/TestDefaultAccountUserApi.java
@@ -26,7 +26,6 @@ import org.testng.annotations.Test;
 import com.ning.billing.account.AccountTestSuiteWithEmbeddedDB;
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountData;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.account.api.DefaultAccount;
 import com.ning.billing.account.api.DefaultMutableAccountData;
 import com.ning.billing.account.api.MigrationAccountData;
@@ -55,7 +54,7 @@ public class TestDefaultAccountUserApi extends AccountTestSuiteWithEmbeddedDB {
         final Account account = accountUserApi.createAccount(new DefaultAccount(createTestAccount()), callContext);
 
         // Update the address and leave other fields null
-        final MutableAccountData mutableAccountData = new DefaultMutableAccountData(null, null, null, 0, null, null, null,
+        final MutableAccountData mutableAccountData = new DefaultMutableAccountData(null, null, null, 0, null, 0, null,
                                                                                     null, null, null, null, null, null,
                                                                                     null, null, null, null, false, false);
         final String newAddress1 = UUID.randomUUID().toString();
@@ -68,8 +67,7 @@ public class TestDefaultAccountUserApi extends AccountTestSuiteWithEmbeddedDB {
         Assert.assertEquals(retrievedAccount.getAddress2(), account.getAddress2());
         Assert.assertEquals(retrievedAccount.getCurrency(), account.getCurrency());
         Assert.assertEquals(retrievedAccount.getExternalKey(), account.getExternalKey());
-        Assert.assertEquals(retrievedAccount.getBillCycleDay().getDayOfMonthLocal(), account.getBillCycleDay().getDayOfMonthLocal());
-        Assert.assertEquals(retrievedAccount.getBillCycleDay().getDayOfMonthUTC(), account.getBillCycleDay().getDayOfMonthUTC());
+        Assert.assertEquals(retrievedAccount.getBillCycleDayLocal(), account.getBillCycleDayLocal());
     }
 
     @Test(groups = "slow", expectedExceptions = IllegalArgumentException.class)
@@ -77,17 +75,7 @@ public class TestDefaultAccountUserApi extends AccountTestSuiteWithEmbeddedDB {
         final Account account = accountUserApi.createAccount(new DefaultAccount(createTestAccount()), callContext);
 
         final MutableAccountData otherAccount = new DefaultAccount(account.getId(), account).toMutableAccountData();
-        otherAccount.setBillCycleDay(new BillCycleDay() {
-            @Override
-            public int getDayOfMonthUTC() {
-                return account.getBillCycleDay().getDayOfMonthUTC() + 2;
-            }
-
-            @Override
-            public int getDayOfMonthLocal() {
-                return account.getBillCycleDay().getDayOfMonthLocal() + 2;
-            }
-        });
+        otherAccount.setBillCycleDayLocal(account.getBillCycleDayLocal() + 2);
 
         accountUserApi.updateAccount(new DefaultAccount(account.getId(), otherAccount), callContext);
     }
diff --git a/account/src/test/java/com/ning/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java b/account/src/test/java/com/ning/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java
index 8eb1f26..5de0e23 100644
--- a/account/src/test/java/com/ning/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java
+++ b/account/src/test/java/com/ning/billing/account/api/user/TestDefaultAccountUserApiWithMocks.java
@@ -27,10 +27,8 @@ import org.testng.annotations.Test;
 import com.ning.billing.account.AccountTestSuiteNoDB;
 import com.ning.billing.account.api.AccountData;
 import com.ning.billing.account.api.AccountEmail;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.account.api.DefaultAccount;
 import com.ning.billing.account.api.DefaultAccountEmail;
-import com.ning.billing.account.api.DefaultBillCycleDay;
 import com.ning.billing.account.dao.AccountDao;
 import com.ning.billing.account.dao.AccountModelDao;
 import com.ning.billing.account.dao.MockAccountDao;
@@ -65,7 +63,7 @@ public class TestDefaultAccountUserApiWithMocks extends AccountTestSuiteNoDB {
         final String name = UUID.randomUUID().toString();
         final Integer firstNameLength = Integer.MAX_VALUE;
         final Currency currency = Currency.BRL;
-        final BillCycleDay billCycleDay = new DefaultBillCycleDay(Integer.MIN_VALUE, Integer.MAX_VALUE);
+        final Integer billCycleDay = Integer.MAX_VALUE;
         final UUID paymentMethodId = UUID.randomUUID();
         final DateTimeZone timeZone = DateTimeZone.UTC;
         final String locale = UUID.randomUUID().toString();
@@ -91,8 +89,7 @@ public class TestDefaultAccountUserApiWithMocks extends AccountTestSuiteNoDB {
         Assert.assertEquals(account.getName(), name);
         Assert.assertEquals(account.getFirstNameLength(), firstNameLength);
         Assert.assertEquals(account.getCurrency(), currency);
-        Assert.assertEquals(account.getBillingCycleDayLocal(), billCycleDay.getDayOfMonthLocal());
-        Assert.assertEquals(account.getBillingCycleDayUtc(), billCycleDay.getDayOfMonthUTC());
+        Assert.assertEquals(account.getBillingCycleDayLocal(), (Integer) billCycleDay);
         Assert.assertEquals(account.getPaymentMethodId(), paymentMethodId);
         Assert.assertEquals(account.getTimeZone(), timeZone);
         Assert.assertEquals(account.getLocale(), locale);
diff --git a/account/src/test/java/com/ning/billing/account/api/user/TestEventJson.java b/account/src/test/java/com/ning/billing/account/api/user/TestEventJson.java
index be2ebc1..d0f82d7 100644
--- a/account/src/test/java/com/ning/billing/account/api/user/TestEventJson.java
+++ b/account/src/test/java/com/ning/billing/account/api/user/TestEventJson.java
@@ -24,7 +24,6 @@ import org.testng.Assert;
 import org.testng.annotations.Test;
 
 import com.ning.billing.account.AccountTestSuiteNoDB;
-import com.ning.billing.account.api.DefaultBillCycleDay;
 import com.ning.billing.account.api.DefaultChangedField;
 import com.ning.billing.account.api.user.DefaultAccountCreationEvent.DefaultAccountData;
 import com.ning.billing.util.events.AccountChangeInternalEvent;
@@ -51,7 +50,7 @@ public class TestEventJson extends AccountTestSuiteNoDB {
 
     @Test(groups = "fast")
     public void testAccountCreationEvent() throws Exception {
-        final DefaultAccountData data = new DefaultAccountData("dsfdsf", "bobo", 3, "bobo@yahoo.com", new DefaultBillCycleDay(12), "USD", UUID.randomUUID(),
+        final DefaultAccountData data = new DefaultAccountData("dsfdsf", "bobo", 3, "bobo@yahoo.com", 12, "USD", UUID.randomUUID(),
                                                                "UTC", "US", "21 avenue", "", "Gling", "San Franciso", "CA", "94110", "USA", "4126789887", false, false);
         final DefaultAccountCreationEvent e = new DefaultAccountCreationEvent(data, UUID.randomUUID(), UUID.randomUUID(), 1L, 45L);
         final String json = mapper.writeValueAsString(e);
diff --git a/account/src/test/java/com/ning/billing/account/dao/TestAccountDao.java b/account/src/test/java/com/ning/billing/account/dao/TestAccountDao.java
index 7e7d379..d58f6d7 100644
--- a/account/src/test/java/com/ning/billing/account/dao/TestAccountDao.java
+++ b/account/src/test/java/com/ning/billing/account/dao/TestAccountDao.java
@@ -31,7 +31,6 @@ import com.ning.billing.account.AccountTestSuiteWithEmbeddedDB;
 import com.ning.billing.account.api.AccountApiException;
 import com.ning.billing.account.api.AccountData;
 import com.ning.billing.account.api.AccountEmail;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.account.api.DefaultAccount;
 import com.ning.billing.account.api.DefaultAccountEmail;
 import com.ning.billing.account.api.MutableAccountData;
@@ -199,49 +198,11 @@ public class TestAccountDao extends AccountTestSuiteWithEmbeddedDB {
     }
 
     @Test(groups = "slow")
-    public void testShouldBeAbleToHandleOtherBCDClass() throws Exception {
-        final AccountModelDao account = createTestAccount();
-        accountDao.create(account, internalCallContext);
-
-        final MutableAccountData otherAccount = new DefaultAccount(account).toMutableAccountData();
-        otherAccount.setAddress1(UUID.randomUUID().toString());
-        otherAccount.setEmail(UUID.randomUUID().toString());
-        // Same BCD, but no .equals method
-        otherAccount.setBillCycleDay(new BillCycleDay() {
-            @Override
-            public int getDayOfMonthUTC() {
-                return account.getBillingCycleDayUtc();
-            }
-
-            @Override
-            public int getDayOfMonthLocal() {
-                return account.getBillingCycleDayLocal();
-            }
-        });
-
-        final AccountModelDao newAccount = new AccountModelDao(account.getId(), otherAccount);
-        accountDao.update(newAccount, internalCallContext);
-
-        final AccountModelDao newFetchedAccount = accountDao.getById(account.getId(), internalCallContext);
-        checkAccountsEqual(newFetchedAccount, newAccount);
-        // Verify it is the same BCD
-        Assert.assertEquals(newFetchedAccount.getBillingCycleDayUtc(), account.getBillingCycleDayUtc());
-        Assert.assertEquals(newFetchedAccount.getBillingCycleDayLocal(), account.getBillingCycleDayLocal());
-    }
-
-    @Test(groups = "slow")
-    public void testShouldBeAbleToHandleBCDOfZeroZero() throws Exception {
+    public void testShouldBeAbleToHandleBCDOfZero() throws Exception {
         final AccountModelDao account = createTestAccount(0);
         accountDao.create(account, internalCallContext);
 
-        final MutableAccountData otherAccount = new DefaultAccount(account).toMutableAccountData();
-        // Set BCD to null
-        otherAccount.setBillCycleDay(null);
-
-        final AccountModelDao newAccount = new AccountModelDao(account.getId(), otherAccount);
-        accountDao.update(newAccount, internalCallContext);
-
-        // Same BCD (zero/zero)
+        // Same BCD (zero)
         final AccountModelDao retrievedAccount = accountDao.getById(account.getId(), internalCallContext);
         checkAccountsEqual(retrievedAccount, account);
     }
diff --git a/api/src/main/java/com/ning/billing/account/api/AccountData.java b/api/src/main/java/com/ning/billing/account/api/AccountData.java
index 77ddfef..e627f86 100644
--- a/api/src/main/java/com/ning/billing/account/api/AccountData.java
+++ b/api/src/main/java/com/ning/billing/account/api/AccountData.java
@@ -64,7 +64,7 @@ public interface AccountData {
      *
      * @see  com.ning.billing.catalog.api.BillingAlignment
      */
-    public BillCycleDay getBillCycleDay();
+    public Integer getBillCycleDayLocal();
 
     /**
      *
diff --git a/api/src/main/java/com/ning/billing/account/api/DefaultMutableAccountData.java b/api/src/main/java/com/ning/billing/account/api/DefaultMutableAccountData.java
index ffe7011..960978b 100644
--- a/api/src/main/java/com/ning/billing/account/api/DefaultMutableAccountData.java
+++ b/api/src/main/java/com/ning/billing/account/api/DefaultMutableAccountData.java
@@ -29,7 +29,7 @@ public class DefaultMutableAccountData implements MutableAccountData {
     private String name;
     private int firstNameLength;
     private Currency currency;
-    private BillCycleDay billCycleDay;
+    private int billCycleDayLocal;
     private UUID paymentMethodId;
     private DateTimeZone timeZone;
     private String locale;
@@ -45,19 +45,18 @@ public class DefaultMutableAccountData implements MutableAccountData {
     private boolean isNotifiedForInvoices;
 
     public DefaultMutableAccountData(final String externalKey, final String email, final String name,
-                                     final int firstNameLength, final Currency currency, final BillCycleDay billCycleDay,
+                                     final int firstNameLength, final Currency currency, final int billCycleDayLocal,
                                      final UUID paymentMethodId, final DateTimeZone timeZone,
                                      final String locale, final String address1, final String address2,
                                      final String companyName, final String city, final String stateOrProvince,
                                      final String country, final String postalCode, final String phone,
                                      final boolean isMigrated, final boolean isNotifiedForInvoices) {
-        super();
         this.externalKey = externalKey;
         this.email = email;
         this.name = name;
         this.firstNameLength = firstNameLength;
         this.currency = currency;
-        this.billCycleDay = billCycleDay;
+        this.billCycleDayLocal = billCycleDayLocal;
         this.paymentMethodId = paymentMethodId;
         this.timeZone = timeZone;
         this.locale = locale;
@@ -74,13 +73,12 @@ public class DefaultMutableAccountData implements MutableAccountData {
     }
 
     public DefaultMutableAccountData(final AccountData accountData) {
-        super();
         this.externalKey = accountData.getExternalKey();
         this.email = accountData.getEmail();
         this.name = accountData.getName();
         this.firstNameLength = accountData.getFirstNameLength();
         this.currency = accountData.getCurrency();
-        this.billCycleDay = accountData.getBillCycleDay();
+        this.billCycleDayLocal = accountData.getBillCycleDayLocal();
         this.paymentMethodId = accountData.getPaymentMethodId();
         this.timeZone = accountData.getTimeZone();
         this.locale = accountData.getLocale();
@@ -122,8 +120,8 @@ public class DefaultMutableAccountData implements MutableAccountData {
     }
 
     @Override
-    public BillCycleDay getBillCycleDay() {
-        return billCycleDay;
+    public Integer getBillCycleDayLocal() {
+        return billCycleDayLocal;
     }
 
     @Override
@@ -217,8 +215,8 @@ public class DefaultMutableAccountData implements MutableAccountData {
     }
 
     @Override
-    public void setBillCycleDay(final BillCycleDay billCycleDay) {
-        this.billCycleDay = billCycleDay;
+    public void setBillCycleDayLocal(final int billCycleDayLocal) {
+        this.billCycleDayLocal = billCycleDayLocal;
     }
 
     @Override
diff --git a/api/src/main/java/com/ning/billing/account/api/MutableAccountData.java b/api/src/main/java/com/ning/billing/account/api/MutableAccountData.java
index 48c464d..b85c701 100644
--- a/api/src/main/java/com/ning/billing/account/api/MutableAccountData.java
+++ b/api/src/main/java/com/ning/billing/account/api/MutableAccountData.java
@@ -65,11 +65,11 @@ public interface MutableAccountData extends AccountData {
     public void setCurrency(Currency currency);
 
     /**
-     * Sets the account billCycleDay
+     * Sets the account billCycleDayLocal
      *
-     * @param billCycleDay
+     * @param billCycleDayLocal
      */
-    public void setBillCycleDay(BillCycleDay billCycleDay);
+    public void setBillCycleDayLocal(int billCycleDayLocal);
 
     /**
      * Sets the UUID of the default paymentMethod
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBundleTransfer.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBundleTransfer.java
index bc58705..c27ac26 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBundleTransfer.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestBundleTransfer.java
@@ -15,20 +15,14 @@
  */
 package com.ning.billing.beatrix.integration;
 
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
 import java.math.BigDecimal;
 import java.util.List;
 
 import org.joda.time.DateTime;
 import org.joda.time.LocalDate;
-import org.testng.annotations.Guice;
 import org.testng.annotations.Test;
 
 import com.ning.billing.account.api.Account;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.api.TestApiListener.NextEvent;
 import com.ning.billing.beatrix.util.InvoiceChecker.ExpectedInvoiceItemCheck;
 import com.ning.billing.catalog.api.BillingPeriod;
@@ -43,6 +37,10 @@ import com.ning.billing.invoice.api.InvoiceItemType;
 
 import com.google.common.collect.ImmutableList;
 
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+
 public class TestBundleTransfer extends TestIntegrationBase {
 
 
@@ -156,11 +154,11 @@ public class TestBundleTransfer extends TestIntegrationBase {
         assertListenerStatus();
 
         // Verify the BCD of the new account
-        final BillCycleDay oldBCD = accountUserApi.getAccountById(account.getId(), callContext).getBillCycleDay();
-        final BillCycleDay newBCD = accountUserApi.getAccountById(newAccount.getId(), callContext).getBillCycleDay();
-        assertEquals(oldBCD.getDayOfMonthUTC(), 1);
+        final Integer oldBCD = accountUserApi.getAccountById(account.getId(), callContext).getBillCycleDayLocal();
+        final Integer newBCD = accountUserApi.getAccountById(newAccount.getId(), callContext).getBillCycleDayLocal();
+        assertEquals(oldBCD, (Integer) 1);
         // Day of the transfer
-        assertEquals(newBCD.getDayOfMonthUTC(), 3);
+        assertEquals(newBCD, (Integer) 3);
 
         final List<Invoice> invoices = invoiceUserApi.getInvoicesByAccount(newAccount.getId(), callContext);
         assertEquals(invoices.size(), 1);
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegrationBase.java b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegrationBase.java
index 6de9d54..6886bf6 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegrationBase.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/integration/TestIntegrationBase.java
@@ -26,7 +26,6 @@ import javax.annotation.Nullable;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 import org.joda.time.LocalDate;
-import org.skife.jdbi.v2.IDBI;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
@@ -72,7 +71,6 @@ import com.ning.billing.invoice.api.InvoiceUserApi;
 import com.ning.billing.invoice.model.InvoicingConfiguration;
 import com.ning.billing.junction.plumbing.api.BlockingSubscription;
 import com.ning.billing.mock.MockAccountBuilder;
-import com.ning.billing.mock.api.MockBillCycleDay;
 import com.ning.billing.overdue.OverdueUserApi;
 import com.ning.billing.overdue.wrapper.OverdueWrapperFactory;
 import com.ning.billing.payment.api.Payment;
@@ -81,7 +79,6 @@ import com.ning.billing.payment.api.PaymentApiException;
 import com.ning.billing.payment.api.PaymentMethodPlugin;
 import com.ning.billing.payment.provider.MockPaymentProviderPlugin;
 import com.ning.billing.util.api.TagUserApi;
-import com.ning.billing.util.clock.ClockMock;
 import com.ning.billing.util.svcapi.account.AccountInternalApi;
 import com.ning.billing.util.svcapi.junction.BlockingInternalApi;
 import com.ning.billing.util.svcsapi.bus.BusService;
@@ -336,7 +333,7 @@ public class TestIntegrationBase extends BeatrixTestSuiteWithEmbeddedDB implemen
                                        .migrated(false)
                                        .isNotifiedForInvoices(false)
                                        .externalKey(UUID.randomUUID().toString().substring(1, 8))
-                                       .billingCycleDay(new MockBillCycleDay(billingDay))
+                                       .billingCycleDayLocal(billingDay)
                                        .currency(Currency.USD)
                                        .paymentMethodId(UUID.randomUUID())
                                        .timeZone(DateTimeZone.UTC)
diff --git a/beatrix/src/test/java/com/ning/billing/beatrix/util/AccountChecker.java b/beatrix/src/test/java/com/ning/billing/beatrix/util/AccountChecker.java
index 6ceb589..6dc368b 100644
--- a/beatrix/src/test/java/com/ning/billing/beatrix/util/AccountChecker.java
+++ b/beatrix/src/test/java/com/ning/billing/beatrix/util/AccountChecker.java
@@ -18,7 +18,6 @@ package com.ning.billing.beatrix.util;
 
 import java.util.UUID;
 
-
 import javax.inject.Inject;
 
 import org.slf4j.Logger;
@@ -37,14 +36,12 @@ public class AccountChecker {
     private final AccountUserApi accountApi;
     private final AuditChecker auditChecker;
 
-
     @Inject
     public AccountChecker(final AccountUserApi accountApi, final AuditChecker auditChecker) {
         this.accountApi = accountApi;
         this.auditChecker = auditChecker;
     }
 
-
     public Account checkAccount(final UUID accountId, final AccountData accountData, final CallContext context) throws Exception {
 
         final Account account = accountApi.getAccountById(accountId, context);
@@ -56,8 +53,7 @@ public class AccountChecker {
             Assert.assertEquals(account.getPhone(), accountData.getPhone());
             Assert.assertEquals(account.isNotifiedForInvoices(), accountData.isNotifiedForInvoices());
             Assert.assertEquals(account.getExternalKey(), accountData.getExternalKey());
-            Assert.assertEquals(account.getBillCycleDay().getDayOfMonthUTC(), accountData.getBillCycleDay().getDayOfMonthUTC());
-            Assert.assertEquals(account.getBillCycleDay().getDayOfMonthLocal(), accountData.getBillCycleDay().getDayOfMonthLocal());
+            Assert.assertEquals(account.getBillCycleDayLocal(), accountData.getBillCycleDayLocal());
             Assert.assertEquals(account.getCurrency(), accountData.getCurrency());
             Assert.assertEquals(account.getTimeZone(), accountData.getTimeZone());
             // createWithPaymentMethod will update the paymentMethod

catalog/pom.xml 26(+26 -0)

diff --git a/catalog/pom.xml b/catalog/pom.xml
index 56968ff..c57578d 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -87,6 +87,32 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>assemble-load-tool-catalog</id>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <createSourcesJar>false</createSourcesJar>
+                            <shadedArtifactAttached>true</shadedArtifactAttached>
+                            <shadedClassifierName>load-tool</shadedClassifierName>
+                            <transformers>
+                                <transformer
+                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <manifestEntries>
+                                        <Main-Class>com.ning.billing.catalog.LoadCatalog</Main-Class>
+                                    </manifestEntries>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>
diff --git a/entitlement/src/test/java/com/ning/billing/entitlement/DefaultEntitlementTestInitializer.java b/entitlement/src/test/java/com/ning/billing/entitlement/DefaultEntitlementTestInitializer.java
index 114b537..ac1c357 100644
--- a/entitlement/src/test/java/com/ning/billing/entitlement/DefaultEntitlementTestInitializer.java
+++ b/entitlement/src/test/java/com/ning/billing/entitlement/DefaultEntitlementTestInitializer.java
@@ -22,12 +22,10 @@ import java.util.UUID;
 
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
-import org.mockito.Mockito;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.ning.billing.account.api.AccountData;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.api.TestApiListener;
 import com.ning.billing.api.TestListenerStatus;
 import com.ning.billing.catalog.DefaultCatalogService;
@@ -63,8 +61,6 @@ public class DefaultEntitlementTestInitializer implements EntitlementTestInitial
     }
 
     public AccountData initAccountData() {
-        final BillCycleDay billCycleDay = Mockito.mock(BillCycleDay.class);
-        Mockito.when(billCycleDay.getDayOfMonthUTC()).thenReturn(1);
         final AccountData accountData = new MockAccountBuilder().name(UUID.randomUUID().toString())
                                                                 .firstNameLength(6)
                                                                 .email(UUID.randomUUID().toString())
@@ -72,7 +68,7 @@ public class DefaultEntitlementTestInitializer implements EntitlementTestInitial
                                                                 .migrated(false)
                                                                 .isNotifiedForInvoices(false)
                                                                 .externalKey(UUID.randomUUID().toString())
-                                                                .billingCycleDay(billCycleDay)
+                                                                .billingCycleDayLocal(1)
                                                                 .currency(Currency.USD)
                                                                 .paymentMethodId(UUID.randomUUID())
                                                                 .timeZone(DateTimeZone.forID("Europe/Paris"))
diff --git a/invoice/src/main/java/com/ning/billing/invoice/generator/DefaultInvoiceGenerator.java b/invoice/src/main/java/com/ning/billing/invoice/generator/DefaultInvoiceGenerator.java
index 6102259..b006da1 100644
--- a/invoice/src/main/java/com/ning/billing/invoice/generator/DefaultInvoiceGenerator.java
+++ b/invoice/src/main/java/com/ning/billing/invoice/generator/DefaultInvoiceGenerator.java
@@ -349,7 +349,7 @@ public class DefaultInvoiceGenerator implements InvoiceGenerator {
             if (!startDate.isAfter(targetDate)) {
                 final LocalDate endDate = (nextEvent == null) ? null : new LocalDate(nextEvent.getEffectiveDate(), nextEvent.getTimeZone());
 
-                final int billCycleDayLocal = thisEvent.getBillCycleDay().getDayOfMonthLocal();
+                final int billCycleDayLocal = thisEvent.getBillCycleDayLocal();
 
                 final List<RecurringInvoiceItemData> itemData;
                 try {
diff --git a/invoice/src/test/java/com/ning/billing/invoice/generator/TestDefaultInvoiceGenerator.java b/invoice/src/test/java/com/ning/billing/invoice/generator/TestDefaultInvoiceGenerator.java
index ab14bf7..0fc291f 100644
--- a/invoice/src/test/java/com/ning/billing/invoice/generator/TestDefaultInvoiceGenerator.java
+++ b/invoice/src/test/java/com/ning/billing/invoice/generator/TestDefaultInvoiceGenerator.java
@@ -16,8 +16,6 @@
 
 package com.ning.billing.invoice.generator;
 
-import static com.ning.billing.invoice.TestInvoiceHelper.*;
-
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -66,6 +64,28 @@ import com.ning.billing.util.svcapi.junction.BillingEvent;
 import com.ning.billing.util.svcapi.junction.BillingEventSet;
 import com.ning.billing.util.svcapi.junction.BillingModeType;
 
+import static com.ning.billing.invoice.TestInvoiceHelper.EIGHT;
+import static com.ning.billing.invoice.TestInvoiceHelper.ELEVEN;
+import static com.ning.billing.invoice.TestInvoiceHelper.FIFTEEN;
+import static com.ning.billing.invoice.TestInvoiceHelper.FIVE;
+import static com.ning.billing.invoice.TestInvoiceHelper.FORTY;
+import static com.ning.billing.invoice.TestInvoiceHelper.FOURTEEN;
+import static com.ning.billing.invoice.TestInvoiceHelper.NINETEEN;
+import static com.ning.billing.invoice.TestInvoiceHelper.NUMBER_OF_DECIMALS;
+import static com.ning.billing.invoice.TestInvoiceHelper.ONE;
+import static com.ning.billing.invoice.TestInvoiceHelper.ONE_HUNDRED;
+import static com.ning.billing.invoice.TestInvoiceHelper.ROUNDING_METHOD;
+import static com.ning.billing.invoice.TestInvoiceHelper.TEN;
+import static com.ning.billing.invoice.TestInvoiceHelper.THIRTEEN;
+import static com.ning.billing.invoice.TestInvoiceHelper.THIRTY;
+import static com.ning.billing.invoice.TestInvoiceHelper.THIRTY_ONE;
+import static com.ning.billing.invoice.TestInvoiceHelper.TWELVE;
+import static com.ning.billing.invoice.TestInvoiceHelper.TWENTY;
+import static com.ning.billing.invoice.TestInvoiceHelper.TWENTY_FIVE;
+import static com.ning.billing.invoice.TestInvoiceHelper.TWENTY_FOUR;
+import static com.ning.billing.invoice.TestInvoiceHelper.TWENTY_SEVEN;
+import static com.ning.billing.invoice.TestInvoiceHelper.TWO;
+import static com.ning.billing.invoice.TestInvoiceHelper.ZERO;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertNull;
@@ -155,16 +175,14 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
 
         // Start date was the 16 local, but was the 17 UTC
         final int bcdLocal = 16;
-        final int bcdUTC = 17;
         final LocalDate startDate = invoiceUtil.buildDate(2012, 7, bcdLocal);
 
         final BillingEventSet events = new MockBillingEventSet();
-        final BillingEvent event = createBillingEvent(sub.getId(), startDate, plan, phase, bcdUTC, bcdLocal);
+        final BillingEvent event = createBillingEvent(sub.getId(), startDate, plan, phase, bcdLocal);
         events.add(event);
 
         // Target date is the next BCD, in local time
         final LocalDate targetDate = invoiceUtil.buildDate(2012, 8, bcdLocal);
-        final DateTimeZone accountTimeZone = DateTimeZone.forID("HST");
         final Invoice invoice = generator.generateInvoice(accountId, events, null, targetDate, Currency.USD);
 
         assertNotNull(invoice);
@@ -181,12 +199,11 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
         final Subscription sub = createZombieSubscription();
         final Plan plan = new MockPlan("Plan with a single discount phase");
         final PlanPhase phaseEvergreen = createMockMonthlyPlanPhase(EIGHT, PhaseType.DISCOUNT);
-        final DateTimeZone accountTimeZone = DateTimeZone.UTC;
-        final int bcdUTC = 16;
+        final int bcdLocal = 16;
         final LocalDate startDate = invoiceUtil.buildDate(2012, 7, 16);
 
         final BillingEventSet events = new MockBillingEventSet();
-        events.add(createBillingEvent(sub.getId(), startDate, plan, phaseEvergreen, bcdUTC));
+        events.add(createBillingEvent(sub.getId(), startDate, plan, phaseEvergreen, bcdLocal));
 
         // Set a target date of today (start date)
         final LocalDate targetDate = startDate;
@@ -749,12 +766,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
     }
 
     private BillingEvent createBillingEvent(final UUID subscriptionId, final LocalDate startDate,
-                                            final Plan plan, final PlanPhase planPhase, final int billCycleDayUTC) throws CatalogApiException {
-        return createBillingEvent(subscriptionId, startDate, plan, planPhase, billCycleDayUTC, billCycleDayUTC);
-    }
-
-    private BillingEvent createBillingEvent(final UUID subscriptionId, final LocalDate startDate,
-                                            final Plan plan, final PlanPhase planPhase, final int billCycleDayUTC, final int billCycleDayLocal) throws CatalogApiException {
+                                            final Plan plan, final PlanPhase planPhase, final int billCycleDayLocal) throws CatalogApiException {
         final Subscription sub = createZombieSubscription(subscriptionId);
         final Currency currency = Currency.USD;
 
@@ -762,7 +774,7 @@ public class TestDefaultInvoiceGenerator extends InvoiceTestSuiteNoDB {
                                                   planPhase.getFixedPrice() == null ? null : planPhase.getFixedPrice().getPrice(currency),
                                                   planPhase.getRecurringPrice() == null ? null : planPhase.getRecurringPrice().getPrice(currency),
                                                   currency, planPhase.getBillingPeriod(),
-                                                  billCycleDayUTC, billCycleDayLocal, BillingModeType.IN_ADVANCE, "Test", 1L, SubscriptionTransitionType.CREATE);
+                                                  billCycleDayLocal, BillingModeType.IN_ADVANCE, "Test", 1L, SubscriptionTransitionType.CREATE);
     }
 
     private void testInvoiceGeneration(final UUID accountId, final BillingEventSet events, final List<Invoice> existingInvoices,
diff --git a/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java b/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java
index fc7eda1..bea73f8 100644
--- a/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java
+++ b/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceDispatcher.java
@@ -26,8 +26,6 @@ import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 import org.joda.time.LocalDate;
 import org.mockito.Mockito;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -123,23 +121,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, 31, BillingModeType.IN_ADVANCE, "CREATE", 1L, SubscriptionTransitionType.CREATE));
+                                                      31, BillingModeType.IN_ADVANCE, "CREATE", 1L, SubscriptionTransitionType.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, 31, BillingModeType.IN_ADVANCE, "PHASE", 2L, SubscriptionTransitionType.PHASE));
+                                                      31, BillingModeType.IN_ADVANCE, "PHASE", 2L, SubscriptionTransitionType.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, 31, BillingModeType.IN_ADVANCE, "", 0L, SubscriptionTransitionType.START_BILLING_DISABLED));
+                                                      31, BillingModeType.IN_ADVANCE, "", 0L, SubscriptionTransitionType.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, 31, BillingModeType.IN_ADVANCE, "", 1L, SubscriptionTransitionType.END_BILLING_DISABLED));
+                                                      31, BillingModeType.IN_ADVANCE, "", 1L, SubscriptionTransitionType.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, 31, BillingModeType.IN_ADVANCE, "CHANGE", 3L, SubscriptionTransitionType.CHANGE));
+                                                      31, BillingModeType.IN_ADVANCE, "CHANGE", 3L, SubscriptionTransitionType.CHANGE));
 
         Mockito.when(billingApi.getBillingEventsForAccountAndUpdateAccountBCD(Mockito.<UUID>any(), Mockito.<InternalCallContext>any())).thenReturn(events);
         final InvoiceNotifier invoiceNotifier = new NullInvoiceNotifier();
diff --git a/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceHelper.java b/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceHelper.java
index 215cf57..64bb62e 100644
--- a/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceHelper.java
+++ b/invoice/src/test/java/com/ning/billing/invoice/TestInvoiceHelper.java
@@ -32,7 +32,6 @@ import org.testng.Assert;
 
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountApiException;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.catalog.MockPlan;
 import com.ning.billing.catalog.MockPlanPhase;
 import com.ning.billing.catalog.api.BillingPeriod;
@@ -45,11 +44,8 @@ import com.ning.billing.entitlement.api.user.Subscription;
 import com.ning.billing.invoice.api.Invoice;
 import com.ning.billing.invoice.api.InvoiceApiException;
 import com.ning.billing.invoice.api.InvoiceItem;
-import com.ning.billing.invoice.api.InvoiceMigrationApi;
 import com.ning.billing.invoice.api.InvoiceNotifier;
 import com.ning.billing.invoice.api.InvoicePayment;
-import com.ning.billing.invoice.api.InvoicePaymentApi;
-import com.ning.billing.invoice.api.InvoiceUserApi;
 import com.ning.billing.invoice.dao.InvoiceDao;
 import com.ning.billing.invoice.dao.InvoiceItemModelDao;
 import com.ning.billing.invoice.dao.InvoiceItemSqlDao;
@@ -57,14 +53,10 @@ import com.ning.billing.invoice.dao.InvoiceModelDao;
 import com.ning.billing.invoice.dao.InvoiceModelDaoHelper;
 import com.ning.billing.invoice.dao.InvoicePaymentModelDao;
 import com.ning.billing.invoice.dao.InvoicePaymentSqlDao;
-import com.ning.billing.invoice.dao.InvoiceSqlDao;
 import com.ning.billing.invoice.generator.InvoiceGenerator;
 import com.ning.billing.invoice.model.InvoicingConfiguration;
 import com.ning.billing.invoice.notification.NullInvoiceNotifier;
-import com.ning.billing.mock.api.MockBillCycleDay;
-import com.ning.billing.util.api.TagUserApi;
 import com.ning.billing.util.callcontext.InternalCallContext;
-import com.ning.billing.util.callcontext.InternalCallContextFactory;
 import com.ning.billing.util.callcontext.InternalTenantContext;
 import com.ning.billing.util.clock.Clock;
 import com.ning.billing.util.entity.EntityPersistenceException;
@@ -218,7 +210,7 @@ public class TestInvoiceHelper {
         Mockito.when(account.getCurrency()).thenReturn(accountCurrency);
         Mockito.when(account.getId()).thenReturn(accountId);
         Mockito.when(account.isNotifiedForInvoices()).thenReturn(true);
-        Mockito.when(account.getBillCycleDay()).thenReturn(new MockBillCycleDay(31));
+        Mockito.when(account.getBillCycleDayLocal()).thenReturn(31);
         // The timezone is required to compute the date of the next invoice notification
         Mockito.when(account.getTimeZone()).thenReturn(DateTimeZone.UTC);
 
@@ -299,21 +291,8 @@ public class TestInvoiceHelper {
                                                final DateTime effectiveDate,
                                                final Plan plan, final PlanPhase planPhase,
                                                @Nullable final BigDecimal fixedPrice, @Nullable final BigDecimal recurringPrice,
-                                               final Currency currency, final BillingPeriod billingPeriod, final int billCycleDayUTC,
-                                               final BillingModeType billingModeType, final String description,
-                                               final long totalOrdering,
-                                               final SubscriptionTransitionType type) {
-        return createMockBillingEvent(account, subscription, effectiveDate, plan, planPhase, fixedPrice, recurringPrice,
-                                      currency, billingPeriod, billCycleDayUTC, billCycleDayUTC, billingModeType, description,
-                                      totalOrdering, type);
-    }
-
-    public BillingEvent createMockBillingEvent(@Nullable final Account account, final Subscription subscription,
-                                               final DateTime effectiveDate,
-                                               final Plan plan, final PlanPhase planPhase,
-                                               @Nullable final BigDecimal fixedPrice, @Nullable final BigDecimal recurringPrice,
                                                final Currency currency, final BillingPeriod billingPeriod,
-                                               final int billCycleDayUTC, final int billCycleDayLocal,
+                                               final int billCycleDayLocal,
                                                final BillingModeType billingModeType, final String description,
                                                final long totalOrdering,
                                                final SubscriptionTransitionType type) {
@@ -324,18 +303,8 @@ public class TestInvoiceHelper {
             }
 
             @Override
-            public BillCycleDay getBillCycleDay() {
-                return new BillCycleDay() {
-                    @Override
-                    public int getDayOfMonthUTC() {
-                        return billCycleDayUTC;
-                    }
-
-                    @Override
-                    public int getDayOfMonthLocal() {
-                        return billCycleDayLocal;
-                    }
-                };
+            public int getBillCycleDayLocal() {
+                return billCycleDayLocal;
             }
 
             @Override
diff --git a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJson.java b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJson.java
index f48597b..f57124f 100644
--- a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJson.java
+++ b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJson.java
@@ -22,7 +22,6 @@ import org.joda.time.DateTimeZone;
 
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountData;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.catalog.api.Currency;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
@@ -33,7 +32,7 @@ public class AccountJson extends AccountJsonSimple {
     protected final String name;
     protected final Integer length;
     protected final String email;
-    protected final BillCycleDayJson billCycleDayJson;
+    protected final Integer billCycleDayLocal;
     protected final String currency;
     protected final String paymentMethodId;
     protected final String timeZone;
@@ -54,7 +53,7 @@ public class AccountJson extends AccountJsonSimple {
         this.name = account.getName();
         this.length = account.getFirstNameLength();
         this.email = account.getEmail();
-        this.billCycleDayJson = new BillCycleDayJson(account.getBillCycleDay());
+        this.billCycleDayLocal = account.getBillCycleDayLocal();
         this.currency = account.getCurrency() != null ? account.getCurrency().toString() : null;
         this.paymentMethodId = account.getPaymentMethodId() != null ? account.getPaymentMethodId().toString() : null;
         this.timeZone = account.getTimeZone().toString();
@@ -158,22 +157,8 @@ public class AccountJson extends AccountJsonSimple {
             }
 
             @Override
-            public BillCycleDay getBillCycleDay() {
-                if (billCycleDayJson == null) {
-                    return null;
-                }
-
-                return new BillCycleDay() {
-                    @Override
-                    public int getDayOfMonthUTC() {
-                        return billCycleDayJson.getDayOfMonthUTC();
-                    }
-
-                    @Override
-                    public int getDayOfMonthLocal() {
-                        return billCycleDayJson.getDayOfMonthLocal();
-                    }
-                };
+            public Integer getBillCycleDayLocal() {
+                return billCycleDayLocal;
             }
 
             @Override
@@ -194,7 +179,7 @@ public class AccountJson extends AccountJsonSimple {
                        @JsonProperty("firstNameLength") final Integer length,
                        @JsonProperty("externalKey") final String externalKey,
                        @JsonProperty("email") final String email,
-                       @JsonProperty("billCycleDay") final BillCycleDayJson billCycleDay,
+                       @JsonProperty("billCycleDayLocal") final Integer billCycleDayLocal,
                        @JsonProperty("currency") final String currency,
                        @JsonProperty("paymentMethodId") final String paymentMethodId,
                        @JsonProperty("timezone") final String timeZone,
@@ -213,7 +198,7 @@ public class AccountJson extends AccountJsonSimple {
         this.name = name;
         this.length = length;
         this.email = email;
-        this.billCycleDayJson = billCycleDay;
+        this.billCycleDayLocal = billCycleDayLocal;
         this.currency = currency;
         this.paymentMethodId = paymentMethodId;
         this.timeZone = timeZone;
@@ -242,8 +227,8 @@ public class AccountJson extends AccountJsonSimple {
         return email;
     }
 
-    public BillCycleDayJson getBillCycleDay() {
-        return billCycleDayJson;
+    public Integer getBillCycleDayLocal() {
+        return billCycleDayLocal;
     }
 
     public String getCurrency() {
@@ -311,7 +296,7 @@ public class AccountJson extends AccountJsonSimple {
         sb.append("{name='").append(name).append('\'');
         sb.append(", length=").append(length);
         sb.append(", email='").append(email).append('\'');
-        sb.append(", billCycleDayJson=").append(billCycleDayJson);
+        sb.append(", billCycleDayJson=").append(billCycleDayLocal);
         sb.append(", currency='").append(currency).append('\'');
         sb.append(", paymentMethodId='").append(paymentMethodId).append('\'');
         sb.append(", timeZone='").append(timeZone).append('\'');
@@ -356,7 +341,7 @@ public class AccountJson extends AccountJsonSimple {
         if (address2 != null ? !address2.equals(that.address2) : that.address2 != null) {
             return false;
         }
-        if (billCycleDayJson != null ? !billCycleDayJson.equals(that.billCycleDayJson) : that.billCycleDayJson != null) {
+        if (billCycleDayLocal != null ? !billCycleDayLocal.equals(that.billCycleDayLocal) : that.billCycleDayLocal != null) {
             return false;
         }
         if (city != null ? !city.equals(that.city) : that.city != null) {
@@ -417,7 +402,7 @@ public class AccountJson extends AccountJsonSimple {
         result = 31 * result + (name != null ? name.hashCode() : 0);
         result = 31 * result + (length != null ? length.hashCode() : 0);
         result = 31 * result + (email != null ? email.hashCode() : 0);
-        result = 31 * result + (billCycleDayJson != null ? billCycleDayJson.hashCode() : 0);
+        result = 31 * result + (billCycleDayLocal != null ? billCycleDayLocal.hashCode() : 0);
         result = 31 * result + (currency != null ? currency.hashCode() : 0);
         result = 31 * result + (paymentMethodId != null ? paymentMethodId.hashCode() : 0);
         result = 31 * result + (timeZone != null ? timeZone.hashCode() : 0);
diff --git a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJsonWithBalance.java b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJsonWithBalance.java
index 9607d56..e25c86e 100644
--- a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJsonWithBalance.java
+++ b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJsonWithBalance.java
@@ -38,7 +38,7 @@ public class AccountJsonWithBalance extends AccountJson {
                                   @JsonProperty("firstNameLength") final Integer length,
                                   @JsonProperty("externalKey") final String externalKey,
                                   @JsonProperty("email") final String email,
-                                  @JsonProperty("billCycleDay") final BillCycleDayJson billCycleDay,
+                                  @JsonProperty("billCycleDayLocal") final Integer billCycleDayLocal,
                                   @JsonProperty("currency") final String currency,
                                   @JsonProperty("paymentMethodId") final String paymentMethodId,
                                   @JsonProperty("timezone") final String timeZone,
@@ -54,7 +54,7 @@ public class AccountJsonWithBalance extends AccountJson {
                                   @JsonProperty("isMigrated") final Boolean isMigrated,
                                   @JsonProperty("isNotifiedForInvoices") final Boolean isNotifiedForInvoices,
                                   @JsonProperty("accountBalance") final BigDecimal accountBalance) {
-        super(accountId, name, length, externalKey, email, billCycleDay, currency, paymentMethodId, timeZone,
+        super(accountId, name, length, externalKey, email, billCycleDayLocal, currency, paymentMethodId, timeZone,
               address1, address2, postalCode, company, city, state, country, locale, phone, isMigrated, isNotifiedForInvoices);
         this.accountBalance = accountBalance;
     }
diff --git a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJsonWithBalanceAndCBA.java b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJsonWithBalanceAndCBA.java
index ff3a437..4b00470 100644
--- a/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJsonWithBalanceAndCBA.java
+++ b/jaxrs/src/main/java/com/ning/billing/jaxrs/json/AccountJsonWithBalanceAndCBA.java
@@ -38,7 +38,7 @@ public class AccountJsonWithBalanceAndCBA extends AccountJsonWithBalance {
                                         @JsonProperty("firstNameLength") final Integer length,
                                         @JsonProperty("externalKey") final String externalKey,
                                         @JsonProperty("email") final String email,
-                                        @JsonProperty("billCycleDay") final BillCycleDayJson billCycleDay,
+                                        @JsonProperty("billCycleDayLocal") final Integer billCycleDayLocal,
                                         @JsonProperty("currency") final String currency,
                                         @JsonProperty("paymentMethodId") final String paymentMethodId,
                                         @JsonProperty("timezone") final String timeZone,
@@ -55,7 +55,7 @@ public class AccountJsonWithBalanceAndCBA extends AccountJsonWithBalance {
                                         @JsonProperty("isNotifiedForInvoices") final Boolean isNotifiedForInvoices,
                                         @JsonProperty("accountBalance") final BigDecimal accountBalance,
                                         @JsonProperty("accountCBA") final BigDecimal accountCBA) {
-        super(accountId, name, length, externalKey, email, billCycleDay, currency, paymentMethodId, timeZone, address1,
+        super(accountId, name, length, externalKey, email, billCycleDayLocal, currency, paymentMethodId, timeZone, address1,
               address2, postalCode, company, city, state, country, locale, phone, isMigrated, isNotifiedForInvoices, accountBalance);
         this.accountCBA = accountCBA;
     }
diff --git a/jaxrs/src/test/java/com/ning/billing/jaxrs/json/TestAccountJson.java b/jaxrs/src/test/java/com/ning/billing/jaxrs/json/TestAccountJson.java
index 1b73168..4c8bf55 100644
--- a/jaxrs/src/test/java/com/ning/billing/jaxrs/json/TestAccountJson.java
+++ b/jaxrs/src/test/java/com/ning/billing/jaxrs/json/TestAccountJson.java
@@ -26,7 +26,6 @@ import com.ning.billing.account.api.Account;
 import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.jaxrs.JaxrsTestSuiteNoDB;
 import com.ning.billing.mock.MockAccountBuilder;
-import com.ning.billing.mock.api.MockBillCycleDay;
 
 public class TestAccountJson extends JaxrsTestSuiteNoDB {
 
@@ -37,7 +36,7 @@ public class TestAccountJson extends JaxrsTestSuiteNoDB {
         final Integer length = 12;
         final String externalKey = UUID.randomUUID().toString();
         final String email = UUID.randomUUID().toString();
-        final BillCycleDayJson billCycleDay = new BillCycleDayJson(6, 6);
+        final Integer billCycleDayLocal = 6;
         final String currency = UUID.randomUUID().toString();
         final String paymentMethodId = UUID.randomUUID().toString();
         final String timeZone = UUID.randomUUID().toString();
@@ -54,7 +53,7 @@ public class TestAccountJson extends JaxrsTestSuiteNoDB {
         final Boolean isNotifiedForInvoice = false;
 
         final AccountJson accountJson = new AccountJson(accountId, name, length, externalKey,
-                                                        email, billCycleDay, currency, paymentMethodId,
+                                                        email, billCycleDayLocal, currency, paymentMethodId,
                                                         timeZone, address1, address2, postalCode, company, city, state,
                                                         country, locale, phone, isMigrated, isNotifiedForInvoice);
         Assert.assertEquals(accountJson.getAccountId(), accountId);
@@ -62,7 +61,7 @@ public class TestAccountJson extends JaxrsTestSuiteNoDB {
         Assert.assertEquals(accountJson.getLength(), length);
         Assert.assertEquals(accountJson.getExternalKey(), externalKey);
         Assert.assertEquals(accountJson.getEmail(), email);
-        Assert.assertEquals(accountJson.getBillCycleDay(), billCycleDay);
+        Assert.assertEquals(accountJson.getBillCycleDayLocal(), billCycleDayLocal);
         Assert.assertEquals(accountJson.getCurrency(), currency);
         Assert.assertEquals(accountJson.getPaymentMethodId(), paymentMethodId);
         Assert.assertEquals(accountJson.getTimeZone(), timeZone);
@@ -89,7 +88,7 @@ public class TestAccountJson extends JaxrsTestSuiteNoDB {
         accountBuilder.address1(UUID.randomUUID().toString());
         accountBuilder.address2(UUID.randomUUID().toString());
         final int bcd = 4;
-        accountBuilder.billingCycleDay(new MockBillCycleDay(bcd));
+        accountBuilder.billingCycleDayLocal(bcd);
         accountBuilder.city(UUID.randomUUID().toString());
         accountBuilder.companyName(UUID.randomUUID().toString());
         accountBuilder.country(UUID.randomUUID().toString());
@@ -111,7 +110,7 @@ public class TestAccountJson extends JaxrsTestSuiteNoDB {
         final AccountJson accountJson = new AccountJson(account);
         Assert.assertEquals(accountJson.getAddress1(), account.getAddress1());
         Assert.assertEquals(accountJson.getAddress2(), account.getAddress2());
-        Assert.assertEquals(accountJson.getBillCycleDay().toString(), "{\"dayOfMonthLocal\":" + bcd + ",\"dayOfMonthUTC\":" + bcd + "}");
+        Assert.assertEquals(accountJson.getBillCycleDayLocal(), (Integer) bcd);
         Assert.assertEquals(accountJson.getCountry(), account.getCountry());
         Assert.assertEquals(accountJson.getLocale(), account.getLocale());
         Assert.assertEquals(accountJson.getCompany(), account.getCompanyName());
diff --git a/junction/src/main/java/com/ning/billing/junction/plumbing/api/BlockingAccount.java b/junction/src/main/java/com/ning/billing/junction/plumbing/api/BlockingAccount.java
index 03d3b33..e1dbeed 100644
--- a/junction/src/main/java/com/ning/billing/junction/plumbing/api/BlockingAccount.java
+++ b/junction/src/main/java/com/ning/billing/junction/plumbing/api/BlockingAccount.java
@@ -22,7 +22,6 @@ import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 
 import com.ning.billing.account.api.Account;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.account.api.MutableAccountData;
 import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.junction.api.BlockingState;
@@ -78,8 +77,8 @@ public class BlockingAccount implements Account {
     }
 
     @Override
-    public BillCycleDay getBillCycleDay() {
-        return account.getBillCycleDay();
+    public Integer getBillCycleDayLocal() {
+        return account.getBillCycleDayLocal();
     }
 
     @Override
diff --git a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BillCycleDayCalculator.java b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BillCycleDayCalculator.java
index aa1af04..9000579 100644
--- a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BillCycleDayCalculator.java
+++ b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BillCycleDayCalculator.java
@@ -26,7 +26,6 @@ import org.slf4j.LoggerFactory;
 import com.ning.billing.ErrorCode;
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountApiException;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.catalog.api.BillingAlignment;
 import com.ning.billing.catalog.api.Catalog;
 import com.ning.billing.catalog.api.CatalogApiException;
@@ -60,7 +59,7 @@ public class BillCycleDayCalculator {
         this.entitlementApi = entitlementApi;
     }
 
-    protected BillCycleDay calculateBcd(final SubscriptionBundle bundle, final Subscription subscription, final EffectiveSubscriptionInternalEvent transition, final Account account, final InternalCallContext context)
+    protected int calculateBcd(final SubscriptionBundle bundle, final Subscription subscription, final EffectiveSubscriptionInternalEvent transition, final Account account, final InternalCallContext context)
             throws CatalogApiException, AccountApiException, EntitlementUserApiException {
 
         final Catalog catalog = catalogService.getFullCatalog();
@@ -88,13 +87,13 @@ public class BillCycleDayCalculator {
     }
 
     @VisibleForTesting
-    BillCycleDay calculateBcdForAlignment(final BillingAlignment alignment, final SubscriptionBundle bundle, final Subscription subscription,
-                                          final Account account, final Catalog catalog, final Plan plan, final InternalCallContext context) throws AccountApiException, EntitlementUserApiException, CatalogApiException {
-        BillCycleDay result = null;
+    int calculateBcdForAlignment(final BillingAlignment alignment, final SubscriptionBundle bundle, final Subscription subscription,
+                                 final Account account, final Catalog catalog, final Plan plan, final InternalCallContext context) throws AccountApiException, EntitlementUserApiException, CatalogApiException {
+        int result = 0;
         switch (alignment) {
             case ACCOUNT:
-                result = account.getBillCycleDay();
-                if (result == null || result.getDayOfMonthUTC() == 0) {
+                result = account.getBillCycleDayLocal();
+                if (result == 0) {
                     result = calculateBcdFromSubscription(subscription, plan, account, catalog, context);
                 }
                 break;
@@ -112,7 +111,7 @@ public class BillCycleDayCalculator {
                 break;
         }
 
-        if (result == null) {
+        if (result == 0) {
             throw new CatalogApiException(ErrorCode.CAT_INVALID_BILLING_ALIGNMENT, alignment.toString());
         }
 
@@ -120,12 +119,12 @@ public class BillCycleDayCalculator {
     }
 
     @VisibleForTesting
-    BillCycleDay calculateBcdFromSubscription(final Subscription subscription, final Plan plan, final Account account, final Catalog catalog, final InternalCallContext context)
+    int calculateBcdFromSubscription(final Subscription subscription, final Plan plan, final Account account, final Catalog catalog, final InternalCallContext context)
             throws AccountApiException, CatalogApiException {
         // Retrieve the initial phase type for that subscription
         // TODO - this should be extracted somewhere, along with this code above
         final PhaseType initialPhaseType;
-        final List<EffectiveSubscriptionInternalEvent> transitions =  entitlementApi.getAllTransitions(subscription, context);
+        final List<EffectiveSubscriptionInternalEvent> transitions = entitlementApi.getAllTransitions(subscription, context);
         if (transitions.size() == 0) {
             initialPhaseType = null;
         } else {
@@ -144,45 +143,11 @@ public class BillCycleDayCalculator {
         }
 
         final DateTime date = plan.dateOfFirstRecurringNonZeroCharge(subscription.getStartDate(), initialPhaseType);
-        // There are really two kinds of billCycleDay:
-        // - a System billingCycleDay which should be computed from UTC time (in order to get the correct notification time at
-        //   the end of each service period)
-        // - a User billingCycleDay which should align with the account timezone
-        final CalculatedBillCycleDay calculatedBillCycleDay = new CalculatedBillCycleDay(account.getTimeZone(), date);
+        final int bcdUTC = date.toDateTime(DateTimeZone.UTC).getDayOfMonth();
+        final int bcdLocal = date.toDateTime(account.getTimeZone()).getDayOfMonth();
         log.info("Calculated BCD: subscription id {}, subscription start {}, timezone {}, bcd UTC {}, bcd local {}",
-                 new Object[]{subscription.getId(), date.toDateTimeISO(), account.getTimeZone(),
-                              calculatedBillCycleDay.getDayOfMonthUTC(), calculatedBillCycleDay.getDayOfMonthLocal()});
-        return calculatedBillCycleDay;
-    }
-
-    private static final class CalculatedBillCycleDay implements BillCycleDay {
-
-        private final DateTime bcdTime;
-        private final DateTimeZone accountTimeZone;
-
-        private CalculatedBillCycleDay(final DateTimeZone accountTimeZone, final DateTime bcdTime) {
-            this.accountTimeZone = accountTimeZone;
-            this.bcdTime = bcdTime;
-        }
+                 subscription.getId(), date.toDateTimeISO(), account.getTimeZone(), bcdUTC, bcdLocal);
 
-        @Override
-        public int getDayOfMonthUTC() {
-            return bcdTime.toDateTime(DateTimeZone.UTC).getDayOfMonth();
-        }
-
-        @Override
-        public int getDayOfMonthLocal() {
-            return bcdTime.toDateTime(accountTimeZone).getDayOfMonth();
-        }
-
-        @Override
-        public String toString() {
-            final StringBuilder sb = new StringBuilder();
-            sb.append("CalculatedBillCycleDay");
-            sb.append("{bcdTime=").append(bcdTime);
-            sb.append(", accountTimeZone=").append(accountTimeZone);
-            sb.append('}');
-            return sb.toString();
-        }
+        return bcdLocal;
     }
 }
diff --git a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BlockingCalculator.java b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BlockingCalculator.java
index c1aa23d..666a666 100644
--- a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BlockingCalculator.java
+++ b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/BlockingCalculator.java
@@ -29,7 +29,6 @@ import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 
 import com.ning.billing.account.api.Account;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.catalog.api.BillingPeriod;
 import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.catalog.api.Plan;
@@ -193,7 +192,7 @@ public class BlockingCalculator {
 
     protected BillingEvent createNewDisableEvent(final DateTime odEventTime, final BillingEvent previousEvent) {
         final Account account = previousEvent.getAccount();
-        final BillCycleDay billCycleDay = previousEvent.getBillCycleDay();
+        final int billCycleDay = previousEvent.getBillCycleDayLocal();
         final Subscription subscription = previousEvent.getSubscription();
         final DateTime effectiveDate = odEventTime;
         final PlanPhase planPhase = previousEvent.getPlanPhase();
@@ -221,7 +220,7 @@ public class BlockingCalculator {
     protected BillingEvent createNewReenableEvent(final DateTime odEventTime, final BillingEvent previousEvent) {
         // All fields are populated with the event state from before the blocking period, for invoice to resume invoicing
         final Account account = previousEvent.getAccount();
-        final BillCycleDay billCycleDay = previousEvent.getBillCycleDay();
+        final int billCycleDay = previousEvent.getBillCycleDayLocal();
         final Subscription subscription = previousEvent.getSubscription();
         final DateTime effectiveDate = odEventTime;
         final PlanPhase planPhase = previousEvent.getPlanPhase();
diff --git a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/DefaultBillingEvent.java b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/DefaultBillingEvent.java
index c31fd82..4d7e135 100644
--- a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/DefaultBillingEvent.java
+++ b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/DefaultBillingEvent.java
@@ -22,7 +22,6 @@ import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 
 import com.ning.billing.account.api.Account;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.catalog.api.BillingPeriod;
 import com.ning.billing.catalog.api.Catalog;
 import com.ning.billing.catalog.api.CatalogApiException;
@@ -37,7 +36,7 @@ import com.ning.billing.util.svcapi.junction.BillingModeType;
 
 public class DefaultBillingEvent implements BillingEvent {
     private final Account account;
-    private final BillCycleDay billCycleDay;
+    private final int billCycleDayLocal;
     private final Subscription subscription;
     private final DateTime effectiveDate;
     private final PlanPhase planPhase;
@@ -52,10 +51,10 @@ public class DefaultBillingEvent implements BillingEvent {
     private final Long totalOrdering;
     private final DateTimeZone timeZone;
 
-    public DefaultBillingEvent(final Account account, final EffectiveSubscriptionInternalEvent transition, final Subscription subscription, final BillCycleDay billCycleDay, final Currency currency, final Catalog catalog) throws CatalogApiException {
+    public DefaultBillingEvent(final Account account, final EffectiveSubscriptionInternalEvent transition, final Subscription subscription, final int billCycleDayLocal, final Currency currency, final Catalog catalog) throws CatalogApiException {
 
         this.account = account;
-        this.billCycleDay = billCycleDay;
+        this.billCycleDayLocal = billCycleDayLocal;
         this.subscription = subscription;
         effectiveDate = transition.getEffectiveTransitionTime();
         final String planPhaseName = (transition.getTransitionType() != SubscriptionTransitionType.CANCEL) ?
@@ -88,7 +87,7 @@ public class DefaultBillingEvent implements BillingEvent {
 
     public DefaultBillingEvent(final Account account, final Subscription subscription, final DateTime effectiveDate, final Plan plan, final PlanPhase planPhase,
                                final BigDecimal fixedPrice, final BigDecimal recurringPrice, final Currency currency,
-                               final BillingPeriod billingPeriod, final BillCycleDay billCycleDay, final BillingModeType billingModeType,
+                               final BillingPeriod billingPeriod, final int billCycleDayLocal, final BillingModeType billingModeType,
                                final String description, final long totalOrdering, final SubscriptionTransitionType type, final DateTimeZone timeZone) {
         this.account = account;
         this.subscription = subscription;
@@ -99,7 +98,7 @@ public class DefaultBillingEvent implements BillingEvent {
         this.recurringPrice = recurringPrice;
         this.currency = currency;
         this.billingPeriod = billingPeriod;
-        this.billCycleDay = billCycleDay;
+        this.billCycleDayLocal = billCycleDayLocal;
         this.billingModeType = billingModeType;
         this.description = description;
         this.type = type;
@@ -159,8 +158,8 @@ public class DefaultBillingEvent implements BillingEvent {
     }
 
     @Override
-    public BillCycleDay getBillCycleDay() {
-        return billCycleDay;
+    public int getBillCycleDayLocal() {
+        return billCycleDayLocal;
     }
 
     @Override
@@ -250,7 +249,10 @@ public class DefaultBillingEvent implements BillingEvent {
 
         final DefaultBillingEvent that = (DefaultBillingEvent) o;
 
-        if (billCycleDay != that.billCycleDay) {
+        if (billCycleDayLocal != that.billCycleDayLocal) {
+            return false;
+        }
+        if (account != null ? !account.equals(that.account) : that.account != null) {
             return false;
         }
         if (billingModeType != that.billingModeType) {
@@ -262,28 +264,31 @@ public class DefaultBillingEvent implements BillingEvent {
         if (currency != that.currency) {
             return false;
         }
-        if (!description.equals(that.description)) {
+        if (description != null ? !description.equals(that.description) : that.description != null) {
             return false;
         }
-        if (!effectiveDate.equals(that.effectiveDate)) {
+        if (effectiveDate != null ? !effectiveDate.equals(that.effectiveDate) : that.effectiveDate != null) {
             return false;
         }
         if (fixedPrice != null ? !fixedPrice.equals(that.fixedPrice) : that.fixedPrice != null) {
             return false;
         }
-        if (!plan.equals(that.plan)) {
+        if (plan != null ? !plan.equals(that.plan) : that.plan != null) {
             return false;
         }
-        if (!planPhase.equals(that.planPhase)) {
+        if (planPhase != null ? !planPhase.equals(that.planPhase) : that.planPhase != null) {
             return false;
         }
         if (recurringPrice != null ? !recurringPrice.equals(that.recurringPrice) : that.recurringPrice != null) {
             return false;
         }
-        if (!subscription.equals(that.subscription)) {
+        if (subscription != null ? !subscription.equals(that.subscription) : that.subscription != null) {
+            return false;
+        }
+        if (timeZone != null ? !timeZone.equals(that.timeZone) : that.timeZone != null) {
             return false;
         }
-        if (!totalOrdering.equals(that.totalOrdering)) {
+        if (totalOrdering != null ? !totalOrdering.equals(that.totalOrdering) : that.totalOrdering != null) {
             return false;
         }
         if (type != that.type) {
@@ -295,19 +300,21 @@ public class DefaultBillingEvent implements BillingEvent {
 
     @Override
     public int hashCode() {
-        int result = billCycleDay.hashCode();
-        result = 31 * result + subscription.hashCode();
-        result = 31 * result + effectiveDate.hashCode();
-        result = 31 * result + planPhase.hashCode();
-        result = 31 * result + plan.hashCode();
+        int result = account != null ? account.hashCode() : 0;
+        result = 31 * result + billCycleDayLocal;
+        result = 31 * result + (subscription != null ? subscription.hashCode() : 0);
+        result = 31 * result + (effectiveDate != null ? effectiveDate.hashCode() : 0);
+        result = 31 * result + (planPhase != null ? planPhase.hashCode() : 0);
+        result = 31 * result + (plan != null ? plan.hashCode() : 0);
         result = 31 * result + (fixedPrice != null ? fixedPrice.hashCode() : 0);
         result = 31 * result + (recurringPrice != null ? recurringPrice.hashCode() : 0);
-        result = 31 * result + currency.hashCode();
-        result = 31 * result + description.hashCode();
-        result = 31 * result + billingModeType.hashCode();
-        result = 31 * result + billingPeriod.hashCode();
-        result = 31 * result + type.hashCode();
-        result = 31 * result + totalOrdering.hashCode();
+        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 + (billingPeriod != null ? billingPeriod.hashCode() : 0);
+        result = 31 * result + (type != null ? type.hashCode() : 0);
+        result = 31 * result + (totalOrdering != null ? totalOrdering.hashCode() : 0);
+        result = 31 * result + (timeZone != null ? timeZone.hashCode() : 0);
         return result;
     }
 
diff --git a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/DefaultInternalBillingApi.java b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
index 2507897..e6719fd 100644
--- a/junction/src/main/java/com/ning/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
+++ b/junction/src/main/java/com/ning/billing/junction/plumbing/billing/DefaultInternalBillingApi.java
@@ -28,7 +28,6 @@ import org.slf4j.LoggerFactory;
 import com.ning.billing.ObjectType;
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountApiException;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.account.api.MutableAccountData;
 import com.ning.billing.catalog.api.CatalogApiException;
 import com.ning.billing.catalog.api.CatalogService;
@@ -133,15 +132,15 @@ public class DefaultInternalBillingApi implements BillingInternalApi {
         for (final Subscription subscription : subscriptions) {
             for (final EffectiveSubscriptionInternalEvent transition : entitlementApi.getBillingTransitions(subscription, context)) {
                 try {
-                    final BillCycleDay bcd = bcdCalculator.calculateBcd(bundle, subscription, transition, account, context);
+                    final int bcdLocal = bcdCalculator.calculateBcd(bundle, subscription, transition, account, context);
 
-                    if (account.getBillCycleDay().getDayOfMonthUTC() == 0) {
+                    if (account.getBillCycleDayLocal() == 0) {
                         final MutableAccountData modifiedData = account.toMutableAccountData();
-                        modifiedData.setBillCycleDay(bcd);
+                        modifiedData.setBillCycleDayLocal(bcdLocal);
                         accountApi.updateAccount(account.getExternalKey(), modifiedData, context);
                     }
 
-                    final BillingEvent event = new DefaultBillingEvent(account, transition, subscription, bcd, account.getCurrency(), catalogService.getFullCatalog());
+                    final BillingEvent event = new DefaultBillingEvent(account, transition, subscription, bcdLocal, account.getCurrency(), catalogService.getFullCatalog());
                     result.add(event);
                 } catch (CatalogApiException e) {
                     log.error("Failing to identify catalog components while creating BillingEvent from transition: " +
diff --git a/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBillCycleDayCalculator.java b/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBillCycleDayCalculator.java
index d030113..2fc5006 100644
--- a/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBillCycleDayCalculator.java
+++ b/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBillCycleDayCalculator.java
@@ -26,7 +26,6 @@ import org.testng.annotations.Test;
 
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountApiException;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.catalog.api.BillingAlignment;
 import com.ning.billing.catalog.api.Catalog;
 import com.ning.billing.catalog.api.CatalogApiException;
@@ -63,60 +62,55 @@ public class TestBillCycleDayCalculator extends JunctionTestSuiteNoDB {
 
         final Account account = Mockito.mock(Account.class);
         Mockito.when(account.getTimeZone()).thenReturn(accountTimeZone);
-        final BillCycleDay billCycleDay = billCycleDayCalculator.calculateBcdForAlignment(BillingAlignment.BUNDLE, bundle, subscription,
+        final Integer billCycleDayLocal = billCycleDayCalculator.calculateBcdForAlignment(BillingAlignment.BUNDLE, bundle, subscription,
                                                                                           account, catalog, null, internalCallContext);
 
-        Assert.assertEquals(billCycleDay.getDayOfMonthUTC(), expectedBCDUTC);
+        Assert.assertEquals(billCycleDayLocal, (Integer) expectedBCDUTC);
     }
 
     @Test(groups = "fast")
     public void testCalculateBCDWithTimeZoneHST() throws Exception {
         final DateTimeZone accountTimeZone = DateTimeZone.forID("HST");
         final DateTime startDateUTC = new DateTime("2012-07-16T21:17:03.000Z", DateTimeZone.UTC);
-        final int bcdUTC = 16;
         final int bcdLocal = 16;
 
-        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdUTC, bcdLocal);
+        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdLocal);
     }
 
     @Test(groups = "fast")
     public void testCalculateBCDWithTimeZoneCEST() throws Exception {
         final DateTimeZone accountTimeZone = DateTimeZone.forID("Europe/Paris");
         final DateTime startDateUTC = new DateTime("2012-07-16T21:17:03.000Z", DateTimeZone.UTC);
-        final int bcdUTC = 16;
         final int bcdLocal = 16;
 
-        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdUTC, bcdLocal);
+        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdLocal);
     }
 
     @Test(groups = "fast")
     public void testCalculateBCDWithTimeZoneUTC() throws Exception {
         final DateTimeZone accountTimeZone = DateTimeZone.UTC;
         final DateTime startDateUTC = new DateTime("2012-07-16T21:17:03.000Z", DateTimeZone.UTC);
-        final int bcdUTC = 16;
         final int bcdLocal = 16;
 
-        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdUTC, bcdLocal);
+        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdLocal);
     }
 
     @Test(groups = "fast")
     public void testCalculateBCDWithTimeZoneEEST() throws Exception {
         final DateTimeZone accountTimeZone = DateTimeZone.forID("+0300");
         final DateTime startDateUTC = new DateTime("2012-07-16T21:17:03.000Z", DateTimeZone.UTC);
-        final int bcdUTC = 16;
         final int bcdLocal = 17;
 
-        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdUTC, bcdLocal);
+        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdLocal);
     }
 
     @Test(groups = "fast")
     public void testCalculateBCDWithTimeZoneJST() throws Exception {
         final DateTimeZone accountTimeZone = DateTimeZone.forID("Asia/Tokyo");
         final DateTime startDateUTC = new DateTime("2012-07-16T21:17:03.000Z", DateTimeZone.UTC);
-        final int bcdUTC = 16;
         final int bcdLocal = 17;
 
-        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdUTC, bcdLocal);
+        verifyBCDCalculation(accountTimeZone, startDateUTC, bcdLocal);
     }
 
     @Test(groups = "fast")
@@ -124,13 +118,12 @@ public class TestBillCycleDayCalculator extends JunctionTestSuiteNoDB {
         // Test to verify the computations don't rely implicitly on UTC
         final DateTimeZone accountTimeZone = DateTimeZone.forID("Asia/Tokyo");
         final DateTime startDate = new DateTime("2012-07-16T21:17:03.000Z", DateTimeZone.forID("HST"));
-        final int bcdUTC = 16;
         final int bcdLocal = 17;
 
-        verifyBCDCalculation(accountTimeZone, startDate, bcdUTC, bcdLocal);
+        verifyBCDCalculation(accountTimeZone, startDate, bcdLocal);
     }
 
-    private void verifyBCDCalculation(final DateTimeZone accountTimeZone, final DateTime startDateUTC, final int bcdUTC, final int bcdLocal) throws AccountApiException, CatalogApiException {
+    private void verifyBCDCalculation(final DateTimeZone accountTimeZone, final DateTime startDateUTC, final int bcdLocal) throws AccountApiException, CatalogApiException {
         final BillCycleDayCalculator billCycleDayCalculator = new BillCycleDayCalculator(Mockito.mock(CatalogService.class), Mockito.mock(EntitlementInternalApi.class));
 
         final Subscription subscription = Mockito.mock(Subscription.class);
@@ -142,8 +135,7 @@ public class TestBillCycleDayCalculator extends JunctionTestSuiteNoDB {
         final Account account = Mockito.mock(Account.class);
         Mockito.when(account.getTimeZone()).thenReturn(accountTimeZone);
 
-        final BillCycleDay bcd = billCycleDayCalculator.calculateBcdFromSubscription(subscription, plan, account, Mockito.mock(Catalog.class), internalCallContext);
-        Assert.assertEquals(bcd.getDayOfMonthUTC(), bcdUTC);
-        Assert.assertEquals(bcd.getDayOfMonthLocal(), bcdLocal);
+        final Integer bcd = billCycleDayCalculator.calculateBcdFromSubscription(subscription, plan, account, Mockito.mock(Catalog.class), internalCallContext);
+        Assert.assertEquals(bcd, (Integer) bcdLocal);
     }
 }
diff --git a/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBillingApi.java b/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBillingApi.java
index ff2fde3..6c27161 100644
--- a/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBillingApi.java
+++ b/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBillingApi.java
@@ -53,7 +53,6 @@ import com.ning.billing.junction.api.BlockingState;
 import com.ning.billing.junction.dao.MockBlockingStateDao;
 import com.ning.billing.mock.MockEffectiveSubscriptionEvent;
 import com.ning.billing.mock.MockSubscription;
-import com.ning.billing.mock.api.MockBillCycleDay;
 import com.ning.billing.util.api.TagApiException;
 import com.ning.billing.util.callcontext.InternalTenantContext;
 import com.ning.billing.util.events.EffectiveSubscriptionInternalEvent;
@@ -129,7 +128,7 @@ public class TestBillingApi extends JunctionTestSuiteNoDB {
         final Account account = createAccount(10);
 
         final SortedSet<BillingEvent> events = billingInternalApi.getBillingEventsForAccountAndUpdateAccountBCD(account.getId(), internalCallContext);
-        checkFirstEvent(events, nextPlan, account.getBillCycleDay().getDayOfMonthUTC(), subId, now, nextPhase, SubscriptionTransitionType.CREATE.toString());
+        checkFirstEvent(events, nextPlan, account.getBillCycleDayLocal(), subId, now, nextPhase, SubscriptionTransitionType.CREATE.toString());
     }
 
     @Test(groups = "fast")
@@ -194,9 +193,9 @@ public class TestBillingApi extends JunctionTestSuiteNoDB {
         Assert.assertEquals(events.size(), 3);
         final Iterator<BillingEvent> it = events.iterator();
 
-        checkEvent(it.next(), nextPlan, account.getBillCycleDay().getDayOfMonthUTC(), subId, now, nextPhase, SubscriptionTransitionType.CREATE.toString(), nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
-        checkEvent(it.next(), nextPlan, account.getBillCycleDay().getDayOfMonthUTC(), subId, now.plusDays(1), nextPhase, SubscriptionTransitionType.START_BILLING_DISABLED.toString(), null, null);
-        checkEvent(it.next(), nextPlan, account.getBillCycleDay().getDayOfMonthUTC(), subId, now.plusDays(2), nextPhase, SubscriptionTransitionType.END_BILLING_DISABLED.toString(), nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
+        checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now, nextPhase, SubscriptionTransitionType.CREATE.toString(), nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
+        checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now.plusDays(1), nextPhase, SubscriptionTransitionType.START_BILLING_DISABLED.toString(), null, null);
+        checkEvent(it.next(), nextPlan, account.getBillCycleDayLocal(), subId, now.plusDays(2), nextPhase, SubscriptionTransitionType.END_BILLING_DISABLED.toString(), nextPhase.getFixedPrice(), nextPhase.getRecurringPrice());
     }
 
     @Test(groups = "fast")
@@ -252,7 +251,7 @@ public class TestBillingApi extends JunctionTestSuiteNoDB {
             assertNull(event.getRecurringPrice());
         }
 
-        Assert.assertEquals(BCD, event.getBillCycleDay().getDayOfMonthUTC());
+        Assert.assertEquals(BCD, event.getBillCycleDayLocal());
         Assert.assertEquals(id, event.getSubscription().getId());
         Assert.assertEquals(time.getDayOfMonth(), event.getEffectiveDate().getDayOfMonth());
         Assert.assertEquals(nextPhase, event.getPlanPhase());
@@ -266,7 +265,7 @@ public class TestBillingApi extends JunctionTestSuiteNoDB {
 
     private Account createAccount(final int billCycleDay) throws AccountApiException {
         final Account account = Mockito.mock(Account.class);
-        Mockito.when(account.getBillCycleDay()).thenReturn(new MockBillCycleDay(billCycleDay));
+        Mockito.when(account.getBillCycleDayLocal()).thenReturn(billCycleDay);
         Mockito.when(account.getCurrency()).thenReturn(Currency.USD);
         Mockito.when(account.getId()).thenReturn(UUID.randomUUID());
         Mockito.when(account.getTimeZone()).thenReturn(DateTimeZone.UTC);
diff --git a/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBlockingCalculator.java b/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBlockingCalculator.java
index d4b498f..c435d42 100644
--- a/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBlockingCalculator.java
+++ b/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestBlockingCalculator.java
@@ -33,7 +33,6 @@ import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 import com.ning.billing.account.api.Account;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.catalog.MockPlan;
 import com.ning.billing.catalog.MockPlanPhase;
 import com.ning.billing.catalog.api.BillingPeriod;
@@ -48,7 +47,6 @@ import com.ning.billing.junction.api.Blockable.Type;
 import com.ning.billing.junction.api.BlockingState;
 import com.ning.billing.junction.dao.MockBlockingStateDao;
 import com.ning.billing.junction.plumbing.billing.BlockingCalculator.DisabledDuration;
-import com.ning.billing.mock.api.MockBillCycleDay;
 import com.ning.billing.util.svcapi.junction.BillingEvent;
 import com.ning.billing.util.svcapi.junction.BillingModeType;
 import com.ning.billing.util.svcapi.junction.DefaultBlockingState;
@@ -528,7 +526,7 @@ public class TestBlockingCalculator extends JunctionTestSuiteNoDB {
 
     protected BillingEvent createRealEvent(final DateTime effectiveDate, final Subscription subscription, final SubscriptionTransitionType type) {
         final Account account = this.account;
-        final BillCycleDay billCycleDay = new MockBillCycleDay(1);
+        final Integer billCycleDay = 1;
         final PlanPhase planPhase = new MockPlanPhase();
         final Plan plan = new MockPlan();
         final BigDecimal fixedPrice = BigDecimal.TEN;
@@ -573,7 +571,7 @@ public class TestBlockingCalculator extends JunctionTestSuiteNoDB {
         final BillingEvent event = new MockBillingEvent();
 
         final BillingEvent result = blockingCalculator.createNewDisableEvent(now, event);
-        assertEquals(result.getBillCycleDay(), event.getBillCycleDay());
+        assertEquals(result.getBillCycleDayLocal(), event.getBillCycleDayLocal());
         assertEquals(result.getEffectiveDate(), now);
         assertEquals(result.getPlanPhase(), event.getPlanPhase());
         assertEquals(result.getPlan(), event.getPlan());
@@ -594,7 +592,7 @@ public class TestBlockingCalculator extends JunctionTestSuiteNoDB {
         final BillingEvent event = new MockBillingEvent();
 
         final BillingEvent result = blockingCalculator.createNewReenableEvent(now, event);
-        assertEquals(result.getBillCycleDay(), event.getBillCycleDay());
+        assertEquals(result.getBillCycleDayLocal(), event.getBillCycleDayLocal());
         assertEquals(result.getEffectiveDate(), now);
         assertEquals(result.getPlanPhase(), event.getPlanPhase());
         assertEquals(result.getPlan(), event.getPlan());
@@ -613,7 +611,7 @@ public class TestBlockingCalculator extends JunctionTestSuiteNoDB {
 
         public MockBillingEvent() {
             super(account, subscription1, clock.getUTCNow(), null, null, BigDecimal.ZERO, BigDecimal.TEN, Currency.USD, BillingPeriod.ANNUAL,
-                  new MockBillCycleDay(4), BillingModeType.IN_ADVANCE, "", 3L, SubscriptionTransitionType.CREATE, DateTimeZone.UTC);
+                  4, BillingModeType.IN_ADVANCE, "", 3L, SubscriptionTransitionType.CREATE, DateTimeZone.UTC);
         }
     }
 
diff --git a/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestDefaultBillingEvent.java b/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestDefaultBillingEvent.java
index 0e9a636..e2b8f2c 100644
--- a/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestDefaultBillingEvent.java
+++ b/junction/src/test/java/com/ning/billing/junction/plumbing/billing/TestDefaultBillingEvent.java
@@ -44,7 +44,6 @@ import com.ning.billing.entitlement.api.SubscriptionTransitionType;
 import com.ning.billing.entitlement.api.user.Subscription;
 import com.ning.billing.junction.JunctionTestSuiteNoDB;
 import com.ning.billing.mock.MockAccountBuilder;
-import com.ning.billing.mock.api.MockBillCycleDay;
 import com.ning.billing.util.svcapi.junction.BillingEvent;
 import com.ning.billing.util.svcapi.junction.BillingModeType;
 
@@ -190,7 +189,7 @@ public class TestDefaultBillingEvent extends JunctionTestSuiteNoDB {
         final Account account = new MockAccountBuilder().build();
         return new DefaultBillingEvent(account, sub, effectiveDate,
                                        shotgun, shotgunMonthly,
-                                       BigDecimal.ZERO, null, Currency.USD, BillingPeriod.NO_BILLING_PERIOD, new MockBillCycleDay(billCycleDay),
+                                       BigDecimal.ZERO, null, Currency.USD, BillingPeriod.NO_BILLING_PERIOD, billCycleDay,
                                        BillingModeType.IN_ADVANCE, "Test Event 1", totalOrdering, type, DateTimeZone.UTC);
     }
 
diff --git a/payment/src/test/java/com/ning/billing/payment/TestPaymentHelper.java b/payment/src/test/java/com/ning/billing/payment/TestPaymentHelper.java
index ad3385a..5455ca8 100644
--- a/payment/src/test/java/com/ning/billing/payment/TestPaymentHelper.java
+++ b/payment/src/test/java/com/ning/billing/payment/TestPaymentHelper.java
@@ -26,7 +26,6 @@ import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.invoice.api.Invoice;
 import com.ning.billing.invoice.api.InvoiceApiException;
 import com.ning.billing.invoice.api.InvoiceItem;
-import com.ning.billing.mock.api.MockBillCycleDay;
 import com.ning.billing.payment.api.PaymentApi;
 import com.ning.billing.payment.api.PaymentMethodPlugin;
 import com.ning.billing.payment.provider.DefaultNoOpPaymentMethodPlugin;
@@ -114,7 +113,7 @@ public class TestPaymentHelper {
         Mockito.when(account.getPhone()).thenReturn("123-456-7890");
         Mockito.when(account.getEmail()).thenReturn(email);
         Mockito.when(account.getCurrency()).thenReturn(Currency.USD);
-        Mockito.when(account.getBillCycleDay()).thenReturn(new MockBillCycleDay(1));
+        Mockito.when(account.getBillCycleDayLocal()).thenReturn(1);
         Mockito.when(account.isMigrated()).thenReturn(false);
         Mockito.when(account.isNotifiedForInvoices()).thenReturn(false);
 
diff --git a/server/src/test/java/com/ning/billing/jaxrs/KillbillClient.java b/server/src/test/java/com/ning/billing/jaxrs/KillbillClient.java
index 3214304..35c7509 100644
--- a/server/src/test/java/com/ning/billing/jaxrs/KillbillClient.java
+++ b/server/src/test/java/com/ning/billing/jaxrs/KillbillClient.java
@@ -44,7 +44,6 @@ import com.ning.billing.catalog.api.ProductCategory;
 import com.ning.billing.jaxrs.json.AccountEmailJson;
 import com.ning.billing.jaxrs.json.AccountJson;
 import com.ning.billing.jaxrs.json.AccountTimelineJson;
-import com.ning.billing.jaxrs.json.BillCycleDayJson;
 import com.ning.billing.jaxrs.json.BundleJsonNoSubscriptions;
 import com.ning.billing.jaxrs.json.ChargebackJson;
 import com.ning.billing.jaxrs.json.CreditJson;
@@ -61,9 +60,7 @@ import com.ning.billing.jaxrs.json.RefundJson;
 import com.ning.billing.jaxrs.json.SubscriptionJsonNoEvents;
 import com.ning.billing.jaxrs.json.TenantJson;
 import com.ning.billing.jaxrs.resources.JaxrsResource;
-import com.ning.billing.server.ServerTestSuiteWithEmbeddedDB;
 import com.ning.billing.util.api.AuditLevel;
-import com.ning.billing.util.clock.ClockMock;
 import com.ning.http.client.AsyncCompletionHandler;
 import com.ning.http.client.AsyncHttpClient;
 import com.ning.http.client.AsyncHttpClient.BoundRequestBuilder;
@@ -910,8 +907,6 @@ public abstract class KillbillClient extends GuicyKillbillTestSuiteWithEmbeddedD
     public AccountJson getAccountJson(final String name, final String externalKey, final String email) {
         final String accountId = UUID.randomUUID().toString();
         final int length = 4;
-        // Let junction figure it out
-        final BillCycleDayJson billCycleDay = null;
         final String currency = DEFAULT_CURRENCY;
         final String timeZone = "UTC";
         final String address1 = "12 rue des ecoles";
@@ -925,7 +920,7 @@ public abstract class KillbillClient extends GuicyKillbillTestSuiteWithEmbeddedD
         final String phone = "81 53 26 56";
 
         // Note: the accountId payload is ignored on account creation
-        return new AccountJson(accountId, name, length, externalKey, email, billCycleDay, currency, null, timeZone,
+        return new AccountJson(accountId, name, length, externalKey, email, null, currency, null, timeZone,
                                address1, address2, postalCode, company, city, state, country, locale, phone, false, false);
     }
 
diff --git a/server/src/test/java/com/ning/billing/jaxrs/TestAccount.java b/server/src/test/java/com/ning/billing/jaxrs/TestAccount.java
index b55604c..c1d87c6 100644
--- a/server/src/test/java/com/ning/billing/jaxrs/TestAccount.java
+++ b/server/src/test/java/com/ning/billing/jaxrs/TestAccount.java
@@ -25,16 +25,12 @@ import java.util.UUID;
 
 import javax.ws.rs.core.Response.Status;
 
-import org.joda.time.DateTime;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
 import com.ning.billing.jaxrs.json.AccountJson;
 import com.ning.billing.jaxrs.json.AccountJsonWithBalance;
-import com.ning.billing.jaxrs.json.AccountTimelineJson;
-import com.ning.billing.jaxrs.json.BillCycleDayJson;
 import com.ning.billing.jaxrs.json.CustomFieldJson;
-import com.ning.billing.jaxrs.json.InvoiceJsonSimple;
 import com.ning.billing.jaxrs.json.PaymentJsonSimple;
 import com.ning.billing.jaxrs.json.PaymentMethodJson;
 import com.ning.billing.jaxrs.json.RefundJson;
@@ -64,7 +60,7 @@ public class TestAccount extends TestJaxrsBase {
 
         // Update Account
         final AccountJson newInput = new AccountJson(input.getAccountId(),
-                                                     "zozo", 4, input.getExternalKey(), "rr@google.com", new BillCycleDayJson(18, 18),
+                                                     "zozo", 4, input.getExternalKey(), "rr@google.com", 18,
                                                      "USD", null, "UTC", "bl1", "bh2", "", "", "ca", "San Francisco", "usa", "en", "415-255-2991",
                                                      false, false);
         final AccountJson updatedAccount = updateAccount(input.getAccountId(), newInput);
diff --git a/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java b/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
index 8cabb96..64d73fa 100644
--- a/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
+++ b/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
@@ -189,14 +189,14 @@ public class TestJaxrsBase extends KillbillClient {
     }
 
     @BeforeMethod(groups = "slow")
-    public void cleanupBeforeMethod() {
+    public void cleanupBeforeMethod() throws Exception {
         busHandler.reset();
         clock.reset();
         clock.setDay(new LocalDate(2012, 8, 25));
     }
 
     @BeforeClass(groups = "slow")
-    public void setupClass() throws IOException {
+    public void setupClass() throws Exception {
         loadConfig();
 
 
diff --git a/server/src/test/java/com/ning/billing/server/security/TestKillbillJdbcRealm.java b/server/src/test/java/com/ning/billing/server/security/TestKillbillJdbcRealm.java
index 2d50a08..f89cf16 100644
--- a/server/src/test/java/com/ning/billing/server/security/TestKillbillJdbcRealm.java
+++ b/server/src/test/java/com/ning/billing/server/security/TestKillbillJdbcRealm.java
@@ -29,7 +29,7 @@ import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 import com.ning.billing.dbi.MysqlTestingHelper;
-import com.ning.billing.server.ServerTestSuiteWithEmbeddedDB;
+import com.ning.billing.jaxrs.TestJaxrsBase;
 import com.ning.billing.tenant.api.DefaultTenant;
 import com.ning.billing.tenant.dao.DefaultTenantDao;
 import com.ning.billing.tenant.dao.TenantModelDao;
@@ -39,13 +39,17 @@ import com.ning.billing.util.dao.DefaultNonEntityDao;
 import com.jolbox.bonecp.BoneCPConfig;
 import com.jolbox.bonecp.BoneCPDataSource;
 
-public class TestKillbillJdbcRealm extends ServerTestSuiteWithEmbeddedDB {
+public class TestKillbillJdbcRealm extends TestJaxrsBase {
 
     private SecurityManager securityManager;
     private DefaultTenant tenant;
 
+    @Override
     @BeforeMethod(groups = "slow")
-    public void setUp() throws Exception {
+    public void cleanupBeforeMethod() throws Exception {
+
+        super.cleanupBeforeMethod();
+
         // Create the tenant
         final CacheControllerDispatcher controllerDispatcher = new CacheControllerDispatcher();
         final DefaultTenantDao tenantDao = new DefaultTenantDao(getDBI(), clock, controllerDispatcher, new DefaultNonEntityDao(getDBI()));
diff --git a/util/src/main/java/com/ning/billing/util/svcapi/junction/BillingEvent.java b/util/src/main/java/com/ning/billing/util/svcapi/junction/BillingEvent.java
index 99e9eeb..9b69fa2 100644
--- a/util/src/main/java/com/ning/billing/util/svcapi/junction/BillingEvent.java
+++ b/util/src/main/java/com/ning/billing/util/svcapi/junction/BillingEvent.java
@@ -22,7 +22,6 @@ import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 
 import com.ning.billing.account.api.Account;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.catalog.api.BillingPeriod;
 import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.catalog.api.Plan;
@@ -38,11 +37,11 @@ public interface BillingEvent extends Comparable<BillingEvent> {
     public Account getAccount();
 
     /**
-     * @return the billCycleDay as seen for that subscription at that time
+     * @return the billCycleDay in the account timezone as seen for that subscription at that time
      *         <p/>
      *         Note: The billCycleDay may come from the Account, or the bundle or the subscription itself
      */
-    public BillCycleDay getBillCycleDay();
+    public int getBillCycleDayLocal();
 
     /**
      * @return the subscription
diff --git a/util/src/test/java/com/ning/billing/mock/api/MockAccountUserApi.java b/util/src/test/java/com/ning/billing/mock/api/MockAccountUserApi.java
index 17137c5..6b0fbd1 100644
--- a/util/src/test/java/com/ning/billing/mock/api/MockAccountUserApi.java
+++ b/util/src/test/java/com/ning/billing/mock/api/MockAccountUserApi.java
@@ -28,7 +28,6 @@ import com.ning.billing.account.api.AccountApiException;
 import com.ning.billing.account.api.AccountData;
 import com.ning.billing.account.api.AccountEmail;
 import com.ning.billing.account.api.AccountUserApi;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.account.api.MigrationAccountData;
 import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.mock.MockAccountBuilder;
@@ -45,7 +44,7 @@ public class MockAccountUserApi implements AccountUserApi {
                                  final String name,
                                  final int firstNameLength,
                                  final Currency currency,
-                                 final BillCycleDay billCycleDay,
+                                 final int billCycleDayLocal,
                                  final UUID paymentMethodId,
                                  final DateTimeZone timeZone,
                                  final String locale,
@@ -57,13 +56,12 @@ public class MockAccountUserApi implements AccountUserApi {
                                  final String country,
                                  final String postalCode,
                                  final String phone) {
-
         final Account result = new MockAccountBuilder(id)
                 .externalKey(externalKey)
                 .email(email)
                 .name(name).firstNameLength(firstNameLength)
                 .currency(currency)
-                .billingCycleDay(billCycleDay)
+                .billingCycleDayLocal(billCycleDayLocal)
                 .paymentMethodId(paymentMethodId)
                 .timeZone(timeZone)
                 .locale(locale)
diff --git a/util/src/test/java/com/ning/billing/mock/MockAccountBuilder.java b/util/src/test/java/com/ning/billing/mock/MockAccountBuilder.java
index 8e72a6e..0b447eb 100644
--- a/util/src/test/java/com/ning/billing/mock/MockAccountBuilder.java
+++ b/util/src/test/java/com/ning/billing/mock/MockAccountBuilder.java
@@ -23,7 +23,6 @@ import org.joda.time.DateTimeZone;
 
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountData;
-import com.ning.billing.account.api.BillCycleDay;
 import com.ning.billing.account.api.MutableAccountData;
 import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.junction.api.BlockingState;
@@ -36,7 +35,7 @@ public class MockAccountBuilder {
     private String name = "";
     private int firstNameLength;
     private Currency currency = Currency.USD;
-    private BillCycleDay billingCycleDay;
+    private int billingCycleDayLocal;
     private UUID paymentMethodId;
     private DateTimeZone timeZone = DateTimeZone.UTC;
     private String locale = "";
@@ -65,7 +64,7 @@ public class MockAccountBuilder {
         this.id = UUID.randomUUID();
         this.address1(data.getAddress1());
         this.address2(data.getAddress2());
-        this.billingCycleDay(data.getBillCycleDay());
+        this.billingCycleDayLocal(data.getBillCycleDayLocal());
         this.city(data.getCity());
         this.companyName(data.getCompanyName());
         this.country(data.getCountry());
@@ -104,8 +103,8 @@ public class MockAccountBuilder {
         return this;
     }
 
-    public MockAccountBuilder billingCycleDay(final BillCycleDay billingCycleDay) {
-        this.billingCycleDay = billingCycleDay;
+    public MockAccountBuilder billingCycleDayLocal(final int billingCycleDayLocal) {
+        this.billingCycleDayLocal = billingCycleDayLocal;
         return this;
     }
 
@@ -225,9 +224,9 @@ public class MockAccountBuilder {
             }
 
             @Override
-            public BillCycleDay getBillCycleDay() {
+            public Integer getBillCycleDayLocal() {
 
-                return billingCycleDay;
+                return billingCycleDayLocal;
             }
 
             @Override