Some refactoring & AllJ-oyn test