Refactored and commented model methods; added relevant tests