clean up code in rendering backend to improve consistency
update comments for side effects in backend's macros