Add variable, improve split logic