Factored out main to other file