Refactor: Extract method
Added logical operators.