Refactor conditionals