tidied up renderer code
code tidy