offline modus works
refactoring