Code cleanup and Thok rename