Move some functions to correct files