Refactor callbacks, fix subscription bug