restructurize bethon code