Attempt to fix enchant id and some code cleanup
More code cleanup