reorganized rendering into separate module