moved inline function definition into .c file to prevent duplicate symbol linker error