Nice extraction of functionality here - looks like it got repeated a ton previously. It may be nice to remove the old commented out sections to de-clutter the code a bit!