Refactored methods, and threw some exceptions