Abstraced some code out to a method