Restructured Code and created commhandler.py