smooth refactoring