clean up delegates mess, fix warnings