general refactoring