split functions to smaller granularity.