Added file chooser.
Refactored.