refactor : extract a method