moving a method to where it is used