move conditions into methods