Perform general refactoring