Refactoring and review