Generalization for haxelib use + some optimizing