fix ordering, add autoordering on load + lot of cleanup refacto