remove unnecessary stack expanding code