ADD func based supporting and corresponding testcases
ADD some helper funcs and types