make some functions static and in their .c files