main refactored