Fixed mock not working with before callbacks. Mock now uses shared factory