Converting more functions to extern