Factor logic out of __call__ in preparation for alternate entry point support