split excel processing procedure into several small functions