Refactored and commented methods