Made the split and window functions generic