Clear and refactoring