move some functions into reflectionLib