split main off, added a separate loader