refactorize subscription procedure
refresh code