Refactored and removed comments