some refactoring + added Directory chooser dialog to location