Refactored to remove unnecessary lines