Refactor tickets

Generally overly complicated method. Should be simplified if possible