This function is used only once. Should we define it as a function?