tidy up
updated to to new APIs