Code cleanup: make functions static and use func(void) declarations