moved serialization code off the account class to where it belongs