better function definitions. each function has a more specific task