optimizing draw functions