Use switch instead of if-else
Add documentation for auto_split