refactory code and add killme in backend