some more cleaning up - the exposed errors will need to be fixed