[Minor] Code cleanup

Further cleaning up of main methods to be JUnit tests