some basic logic for registering and pushing