Code refactored for more uniformed formatting.