Offline and some refactors