refactor the ViewGroup handler to pass len(inbox) and len(outbox)