Refactored to enable preview to work

@dantleech but ids are data? why did you add this junk?