[DEV] Refactor main