@lgray @nancymarinelli @beaudett @dbenedet 
The amount of copy-pasted code here is pretty large.
This could've been refactored for a better readability and maintainability.