Added function and controlelr for smart splitting