restructured classes to allow for replaying