Refactored to follow standards