Changed some functions to static