Factorize code drawing shadows.