major refactor of filechooser