Added commandHandler class and performed some changes