move drawing functions to separate file