Refactored (#1) and attempt to debug out the repeating #2