Split some functions into different files