Finishing removing main.
Clean up boilerplate