refactoring main update done