remove unused stuff and parse arrays