Updates for speed and code maintainability.