Replace hard-coded string split with intelligent