optimize the appication of local h