Simplify app.rb's main logic to single case

Reads a little better than multiple `elsif`s and a nested `case`