offline capability refactoring