some refactorings in BeaconService