work on dispacher, organizing the functions