Moved internal functions to be statically declared