(Lakka) Start refactoring questionable C code