Reformatted some of main_handler.py