Nitpick: This is basically an `if-elsif-else` statement implemented with explicit returns, switch to elsifs.