Changed subscription code. More refactorings to follow.