Restructured to be more readable