extract to a method