more main constructor refactoring