refactored draw functions to module