split drawing functions to their own module