refactored draw commands to be a single function