extract rendering into seperated classes