Move inline functions to separate functions in preparation of testing.