Re-organizing drawing code (work in progress...).