Logic cleanup: yay Rubyisms!