refactoring, updates & fixes, offline mode added