refactors renderer to be extendable