Minor code beautification in canvas renderer