use inline function instead of macro