try to guess filename for remote
cleanup imports