Refactored one function.