Refactored as much as possible
got back my main