Split the one big cc file to individual functions