Added preferences (started migrating credentials into this)