Optimized Cruxite code