fix profiles handling.
assert file existence.
add some file collection functions.