I added a method to encapsulate the condition as you suggested.