for convenience
1. modified the function that omitted inline. 2. changed the static global functions to inline functions.