refactoring + draw_functions file