remove unused stuff, fix ordering