Refactor to reduce a bunch of duplicate code
halfassed replay