Restructure for better performance.