inlined the functions