extract fns for better readablity