Medium refactoring.