pulling common code out and creating helper functions that can be shared without code duplication.
swapping code for new helper functions and adding the getApplicant function.