added an offline test
completed messaging sample
refactoring