helper method moved after main method