Updated and refactoring