This was a pretty nice refactor