Start moving common functions into a separate file.