split out method to facilitate the inliner job