Various refactoring tasks