Refactor conditions for readability