Made new method to de-clutter main.