Fix import and refactoring