better function splitting