any way the conditional in this and the next method could be extracted into a method and used for both?