Refactor file.

Extracted new method from conditional expression.