split large function