restructure to make only relevant to haxe