Going to try refactoring the code.