some cleanup, started on direntry funcs