Refactored main method

Now has separate validation method