Broke up handle function into it's own section.