split main from plurgo, prepare for testing