Split some functions in different files.