I think this function is too heavy not be inline.