Refactoring: simplified multiconditional statement.