refactor rendering
reorganize helper functions; add current data