Move renderType beside function that uses it