Refactoring and update