Drawing function separated