change a few functions to package private