split out function oriented bplus tree code