How to avoid callback hell by naming functions and separating code into modules