cleaned up the stub impl